From f01fbe57c949323241e01208ce4c1b125b41aa85 Mon Sep 17 00:00:00 2001 From: alef Date: Sat, 17 Feb 2024 13:35:31 +0100 Subject: [PATCH] Externally link debug info of MINGW executable --- src/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 49eae3a29fb90..a15d77fe0832b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,8 +48,9 @@ if (TILES) ${MESSAGES_CPP} ${RESOURCE_RC}) if(MSYS2) - target_link_options(cataclysm-tiles PRIVATE - "$<$:LINKER:--strip-debug>" + add_custom_command(TARGET cataclysm-tiles POST_BUILD + COMMAND objcopy --only-keep-debug $ $.debug + COMMAND objcopy --strip-unneeded --add-gnu-debuglink=$.debug $ ) else() # Use only our RT_MANIFEST from resource.rc