Skip to content

Commit

Permalink
Externally link debug info of MINGW executable
Browse files Browse the repository at this point in the history
  • Loading branch information
alef committed Feb 17, 2024
1 parent dd7a836 commit f01fbe5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ if (TILES)
${MESSAGES_CPP}
${RESOURCE_RC})
if(MSYS2)
target_link_options(cataclysm-tiles PRIVATE
"$<$<CONFIG:Debug,RelWithDebInfo>:LINKER:--strip-debug>"
add_custom_command(TARGET cataclysm-tiles POST_BUILD
COMMAND objcopy --only-keep-debug $<TARGET_FILE:cataclysm-tiles> $<TARGET_FILE:cataclysm-tiles>.debug
COMMAND objcopy --strip-unneeded --add-gnu-debuglink=$<TARGET_FILE:cataclysm-tiles>.debug $<TARGET_FILE:cataclysm-tiles>
)
else()
# Use only our RT_MANIFEST from resource.rc
Expand Down

0 comments on commit f01fbe5

Please sign in to comment.