From f97c0ded0ec73d4e2e9a195db93d483ecc50467a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 16 Oct 2023 05:06:13 +0200 Subject: fix gcc build --- CMakeLists.txt | 9 +++++---- 1 file 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) -- cgit v1.2.3