If `CMAKE_BUILD_TYPE` is set to `RelWithDebInfo` the debug information
should not be stripped. Currently `strip -x` is called when
`RelWithDebInfo` is set. A useless `echo` is called when `Debug` is set.
Skip `strip -x` when `CMAKE_BUILD_TYPE` is set to `Debug` or
`RelWithDebInfo`.
Forwarded: https://github.com/audacity/audacity/pull/3672
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Gbp-Pq: Name Do-not-strip-debug-info-for-CMAKE_BUILD_TYPE-RelWithDebIn.patch
target_link_options( ${TARGET} PRIVATE ${LOPTS} )
target_link_libraries( ${TARGET} PUBLIC ${LIBRARIES} )
- if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
+ if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND NOT CMAKE_BUILD_TYPE MATCHES "Debug|RelWithDebInfo" )
add_custom_command(
TARGET "${TARGET}"
POST_BUILD
- COMMAND $<IF:$<CONFIG:Debug>,echo,strip> -x $<TARGET_FILE:${TARGET}>
+ COMMAND strip -x $<TARGET_FILE:${TARGET}>
)
endif()