From ffc28199130d003569aa2ccd3e820c486ec757ad Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 12 Sep 2020 17:22:27 +0200 Subject: [PATCH] Use ThinLTO for shared library building. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cd6cfd..eaca0ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,10 @@ endif () set(LIBTYPE STATIC) if (SHARED) set(LIBTYPE SHARED) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_compile_options(-flto=thin) + add_link_options(-flto=thin) + endif () endif (SHARED) SET(FILE_SOURCE