Last active
May 14, 2019 06:45
-
-
Save YarikTH/5ecb69db541eb38977a971d61712d0e5 to your computer and use it in GitHub Desktop.
cmake: Separate debug symbols on gcc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://git.magicalgirl.moe/STJr/SRB2/commit/e08bd452279dbeedbf876fec465ea51a137455a8 | |
| ## strip debug symbols into separate file when using gcc | |
| if(CMAKE_COMPILER_IS_GNUCC) | |
| if(${CMAKE_BUILD_TYPE} MATCHES Debug) | |
| message(STATUS "Will make separate debug symbols in *.debug") | |
| add_custom_command(TARGET ${SRB2_SDL2_EXE_NAME} POST_BUILD | |
| COMMAND ${OBJCOPY} --only-keep-debug $<TARGET_FILE:${SRB2_SDL2_EXE_NAME}> $<TARGET_FILE:${SRB2_SDL2_EXE_NAME}>.debug | |
| COMMAND ${OBJCOPY} --strip-debug $<TARGET_FILE:${SRB2_SDL2_EXE_NAME}> | |
| COMMAND ${OBJCOPY} --add-gnu-debuglink=$<TARGET_FILE_NAME:${SRB2_SDL2_EXE_NAME}>.debug $<TARGET_FILE:${SRB2_SDL2_EXE_NAME}> | |
| ) | |
| endif() | |
| endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment