summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-16 07:05:35 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-16 07:05:35 +0200
commit32e02f820091878c0d04e7aa81bcf08a92353e84 (patch)
tree07739dac15b0b30388128563ee327bfe08f19fb3
parent89d3e4365d68ab4fcf93b275b454303f55fc6352 (diff)
fix non-win32 build
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62a98af2..efbbe0ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -221,11 +221,15 @@ function(fm_add_debug_info self)
if(NOT CMAKE_OBJCOPY)
message(FATAL_ERROR "objcopy missing")
endif()
- set(exe "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${self}.exe")
+ if(WIN32)
+ set(exe "${self}.exe")
+ else()
+ set(exe "${self}")
+ endif()
add_custom_command(TARGET ${self} POST_BUILD
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}"
+ COMMAND "${CMAKE_OBJCOPY}" --add-gnu-debuglink=${exe}.debug "${exe}"
BYPRODUCTS "${exe}.debug"
WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)