diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a15d77fe0832b..fb83f02d8afa6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,9 +48,20 @@ if (TILES) ${MESSAGES_CPP} ${RESOURCE_RC}) if(MSYS2) + 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 objcopy --only-keep-debug $ $.debug - COMMAND objcopy --strip-unneeded --add-gnu-debuglink=$.debug $ + COMMAND "${_keep}" + COMMAND "${_strip}" + COMMAND_EXPAND_LISTS ) else() # Use only our RT_MANIFEST from resource.rc