Skip to content

Commit

Permalink
Merge pull request #71805 from alef/debuglink-mingw
Browse files Browse the repository at this point in the history
Externally link debug info of MINGW executable
  • Loading branch information
Maleclypse authored Feb 18, 2024
2 parents d5b8d5a + e8a02c7 commit 45fcb0e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,20 @@ if (TILES)
${MESSAGES_CPP}
${RESOURCE_RC})
if(MSYS2)
target_link_options(cataclysm-tiles PRIVATE
"$<$<CONFIG:Debug,RelWithDebInfo>:LINKER:--strip-debug>"
set(_KEEP $<$<CONFIG:RelWithDebInfo,Debug>:objcopy
--only-keep-debug
$<TARGET_FILE:cataclysm-tiles>
$<TARGET_FILE:cataclysm-tiles>.debug
>)
set(_STRIP $<$<CONFIG:RelWithDebInfo,Debug>:objcopy
--strip-unneeded
--add-gnu-debuglink=$<TARGET_FILE:cataclysm-tiles>.debug
$<TARGET_FILE:cataclysm-tiles>
>)
add_custom_command(TARGET cataclysm-tiles POST_BUILD
COMMAND "${_KEEP}"
COMMAND "${_STRIP}"
COMMAND_EXPAND_LISTS
)
else()
# Use only our RT_MANIFEST from resource.rc
Expand Down

0 comments on commit 45fcb0e

Please sign in to comment.