build: Move -s
additional compiler flags into linker flags, and enable it only when gcc/clang are used. (#1087)
Compiler when compiling doesn't use them in those cases and emit a warning, which is turned into an error by `-Werror`. Unfortunately, CPack doesn't expose the logic it uses for stripping binaries.
This commit is contained in:
parent
608c9e2e7a
commit
749823e044
@ -1,12 +1,12 @@
|
||||
include(FetchContent)
|
||||
|
||||
if(IMHEX_STRIP_RELEASE)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
set(CPACK_STRIP_FILES TRUE)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
add_link_options($<$<CONFIG:RELEASE>:-s>)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
macro(addDefines)
|
||||
|
Loading…
x
Reference in New Issue
Block a user