diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-28 15:56:05 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-28 15:56:05 +0300 |
commit | ca42f7c7cd008a3a11fc8b3da2bdddfc36e571b2 (patch) | |
tree | 069007ef3c8217f31ebc6051e194522f3317657a | |
parent | Makefile: consistent status messages (diff) | |
download | cmake-common-ca42f7c7cd008a3a11fc8b3da2bdddfc36e571b2.tar.gz cmake-common-ca42f7c7cd008a3a11fc8b3da2bdddfc36e571b2.zip |
common.cmake: symbol stripping was completely broken
Generator expressions aren't evaluated at configuration time. Symbols
were always stripped, unfortunately.
-rw-r--r-- | common.cmake | 12 |
1 files 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 $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>) - 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() |