Configure memory map per target to allow multiple add_executable

pull/14355/head
Ladislas de Toldi 2021-02-26 13:38:37 +01:00
parent 63eeb93a5f
commit fd7ea7305f
No known key found for this signature in database
GPG Key ID: C5241848279CD797
3 changed files with 4 additions and 4 deletions

View File

@ -218,10 +218,10 @@ endfunction()
# Set post build operations
#
function(mbed_set_post_build target)
# The mapfile name includes the top-level target name and the
# The mapfile name includes the top-level target name and the
# executable suffix for all toolchains as CMake hardcodes the name of the
# diagnostic output file for some toolchains.
mbed_configure_memory_map(mbed-core "${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map")
mbed_configure_memory_map(${target} "${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map")
mbed_validate_application_profile(${target})
mbed_generate_bin_hex(${target})

View File

@ -70,7 +70,7 @@ endfunction()
# See https://gitlab.kitware.com/cmake/cmake/-/issues/21538
function(mbed_configure_memory_map target mapfile)
target_link_options(${target}
INTERFACE
PRIVATE
"--map"
"--list=${mapfile}"
)

View File

@ -88,7 +88,7 @@ endfunction()
# Add linker flags to generate a mapfile with a given name
function(mbed_configure_memory_map target mapfile)
target_link_options(${target}
INTERFACE
PRIVATE
"-Wl,-Map=${mapfile}"
)
endfunction()