From 96874909ab72c4005be3ccc4dda8754b44b4d698 Mon Sep 17 00:00:00 2001 From: 6d4m <103454927+6d4m@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:23:13 +0300 Subject: [PATCH] cmake: pass -Map as discrete link option on non-clang-cl builds (#806) LINK_FLAGS is a space-delimited string, so when the build path contains spaces the linker map option is split into bogus arguments and the final link fails: clang++: error: no such file or directory: 'pro/KytyPS5/_Build/linux/kyty_emulator_clang_lld.map' Move -Wl,-Map= out of LINK_FLAGS into target_link_options, which CMake passes to the linker as a single argument. This completes #26 for the WIN32 OR LINUX branch (clang/gcc builds); the clang-cl branch was already converted there. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2b950281..013e2bb59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -677,7 +677,10 @@ if(KYTY_CLANG_CL) ) add_custom_command(TARGET kyty_emulator POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${KYTY_THIRD_PARTY_DIR}/winpthread/bin/libwinpthread-1.dll" $/libwinpthread-1.dll) elseif(WIN32 OR LINUX) - set_target_properties(kyty_emulator PROPERTIES LINK_FLAGS "${KYTY_LD_OPTIONS} -Wl,-Map=${KYTY_EMULATOR_MAP_LINK_PATH}") + set_target_properties(kyty_emulator PROPERTIES LINK_FLAGS "${KYTY_LD_OPTIONS}") + # LINK_FLAGS is a space-delimited string: a -Map path containing spaces would + # be split into bogus arguments, so pass it as a discrete link option instead. + target_link_options(kyty_emulator PRIVATE "-Wl,-Map=${KYTY_EMULATOR_MAP_LINK_PATH}") endif() if(LINUX)