Fix location of map file on Ninja (#2584)

This commit is contained in:
will-v-pi 2025-07-23 14:51:36 +01:00 committed by GitHub
parent 2afa251201
commit 9b876bbc24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,12 +74,11 @@ endfunction()
# add map file generation for the given target # add map file generation for the given target
function(pico_add_map_output TARGET) function(pico_add_map_output TARGET)
pico_get_runtime_output_directory(${TARGET} output_path)
get_target_property(target_type ${TARGET} TYPE) get_target_property(target_type ${TARGET} TYPE)
if ("EXECUTABLE" STREQUAL "${target_type}") if ("EXECUTABLE" STREQUAL "${target_type}")
target_link_options(${TARGET} PRIVATE "LINKER:-Map=${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:OUTPUT_NAME>>,$<TARGET_PROPERTY:OUTPUT_NAME>,$<TARGET_PROPERTY:NAME>>${CMAKE_EXECUTABLE_SUFFIX}.map") target_link_options(${TARGET} PRIVATE "LINKER:-Map=$<TARGET_FILE:${TARGET}>.map")
else () else ()
target_link_options(${TARGET} INTERFACE "LINKER:-Map=${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:OUTPUT_NAME>>,$<TARGET_PROPERTY:OUTPUT_NAME>,$<TARGET_PROPERTY:NAME>>${CMAKE_EXECUTABLE_SUFFIX}.map") target_link_options(${TARGET} INTERFACE "LINKER:-Map=$<TARGET_FILE:${TARGET}>.map")
endif () endif ()
endfunction() endfunction()