diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 49eae3a29fb90..1afe6b62c3b24 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,8 +48,20 @@ if (TILES) ${MESSAGES_CPP} ${RESOURCE_RC}) if(MSYS2) - target_link_options(cataclysm-tiles PRIVATE - "$<$:LINKER:--strip-debug>" + set(_KEEP $<$:objcopy + --only-keep-debug + $ + $.debug + >) + set(_STRIP $<$:objcopy + --strip-unneeded + --add-gnu-debuglink=$.debug + $ + >) + add_custom_command(TARGET cataclysm-tiles POST_BUILD + COMMAND "${_KEEP}" + COMMAND "${_STRIP}" + COMMAND_EXPAND_LISTS ) else() # Use only our RT_MANIFEST from resource.rc