summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-16 05:06:13 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-16 05:20:37 +0200
commitf97c0ded0ec73d4e2e9a195db93d483ecc50467a (patch)
tree2d95bdff18fa38dab60b3b12ac9a4f0c0f586395
parent35c4bdbf30ba05102e7dcc04a1be17816cca9fe1 (diff)
fix gcc build
-rw-r--r--CMakeLists.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f4647544..62a98af2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -221,11 +221,12 @@ function(fm_add_debug_info self)
if(NOT CMAKE_OBJCOPY)
message(FATAL_ERROR "objcopy missing")
endif()
+ set(exe "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${self}.exe")
add_custom_command(TARGET ${self} POST_BUILD
- COMMAND "${CMAKE_OBJCOPY}" --only-keep-debug "${self}.exe" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${self}.exe.debug"
- COMMAND "${CMAKE_OBJCOPY}" --strip-all "${self}.exe" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${self}.exe"
- COMMAND "${CMAKE_OBJCOPY}" --add-gnu-debuglink=${self}.exe.debug "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${self}.exe"
- BYPRODUCTS "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${self}.exe.debug"
+ COMMAND "${CMAKE_OBJCOPY}" --only-keep-debug "${exe}" "${exe}.debug"
+ COMMAND "${CMAKE_OBJCOPY}" --strip-all "${exe}"
+ COMMAND "${CMAKE_OBJCOPY}" --add-gnu-debuglink=${self}.exe.debug "${exe}"
+ BYPRODUCTS "${exe}.debug"
WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${self}.exe.debug" DESTINATION bin)