From 399b1992669f2f5fcdbda1cf5597f50b369d6ab2 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Fri, 18 Oct 2024 20:40:54 +0300 Subject: [PATCH] move --gc-sections to shared libraries only --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75a5d63..507ea28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,7 +161,6 @@ function(give_options_without_warnings target) -O3 -flto=$,thin,auto> -mavx -mavx2 - -Wl,--gc-sections -fdata-sections -ffunction-sections -funroll-loops @@ -177,6 +176,7 @@ function(give_options_without_warnings target) $<$:-gsource-map>) set(BUILD_SHARED_LIBRARY_FLAGS_RELEASE + -Wl,--gc-sections # TODO: is it even needed with LTO? $<$:-Wl,-plugin-opt,cache-dir=${CMAKE_CURRENT_BINARY_DIR}/linker-cache/> $<$:-Wl,-plugin-opt,cache-policy=prune_after=30m>)