From ca42f7c7cd008a3a11fc8b3da2bdddfc36e571b2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 28 Oct 2020 15:56:05 +0300 Subject: common.cmake: symbol stripping was completely broken Generator expressions aren't evaluated at configuration time. Symbols were always stripped, unfortunately. --- common.cmake | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/common.cmake b/common.cmake index 5c55b74..c67f983 100644 --- a/common.cmake +++ b/common.cmake @@ -174,19 +174,17 @@ function(_cc_strip_symbols_gcc target) # target_link_libraries: #target_link_libraries("${target}" PRIVATE -s) - set_property(TARGET "${target}" APPEND_STRING PROPERTY LINK_FLAGS " -s") + set_property(TARGET "${target}" APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " -s") + set_property(TARGET "${target}" APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " -s") endfunction() function(_cc_strip_symbols target) get_target_property(target_type "${target}" TYPE) get_target_property(aliased "${target}" ALIASED_TARGET) if(NOT target_type STREQUAL "INTERFACE_LIBRARY" AND NOT aliased) - set(release_build $,$>) - if(release_build) - message(STATUS "common.cmake: ${target}: Stripping symbols for release configurations") - if(is_gcc) - _cc_strip_symbols_gcc("${target}") - endif() + message(STATUS "common.cmake: ${target}: Stripping symbols for release configurations") + if(is_gcc) + _cc_strip_symbols_gcc("${target}") endif() endif() endfunction() -- cgit v1.2.3