Skip to content

Commit fd7ea73

Browse files
committed
Configure memory map per target to allow multiple add_executable
1 parent 63eeb93 commit fd7ea73

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ endfunction()
218218
# Set post build operations
219219
#
220220
function(mbed_set_post_build target)
221-
# The mapfile name includes the top-level target name and the
221+
# The mapfile name includes the top-level target name and the
222222
# executable suffix for all toolchains as CMake hardcodes the name of the
223223
# diagnostic output file for some toolchains.
224-
mbed_configure_memory_map(mbed-core "${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map")
224+
mbed_configure_memory_map(${target} "${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map")
225225
mbed_validate_application_profile(${target})
226226
mbed_generate_bin_hex(${target})
227227

tools/cmake/toolchains/ARM.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ endfunction()
7070
# See https://gitlab.kitware.com/cmake/cmake/-/issues/21538
7171
function(mbed_configure_memory_map target mapfile)
7272
target_link_options(${target}
73-
INTERFACE
73+
PRIVATE
7474
"--map"
7575
"--list=${mapfile}"
7676
)

tools/cmake/toolchains/GCC_ARM.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ endfunction()
8888
# Add linker flags to generate a mapfile with a given name
8989
function(mbed_configure_memory_map target mapfile)
9090
target_link_options(${target}
91-
INTERFACE
91+
PRIVATE
9292
"-Wl,-Map=${mapfile}"
9393
)
9494
endfunction()

0 commit comments

Comments
 (0)