From b6de3a730b6ce1cf7248f2ec0b2d0d67cc01ee3d Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 12 Sep 2020 16:50:36 +0200 Subject: [PATCH] Use ThinLTO for Clang. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4279472..46215a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,11 @@ if (SHARED) set(LIBTYPE SHARED) endif (SHARED) +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_compile_options(-flto=thin) + add_link_options(-flto=thin) +endif () + if (NOT WINDOWS) # Include debug symbols in all linux builds add_compile_options(-g -gfull -g3)