Skip to content

Commit 207dcbb

Browse files
committed
CMake: move Gcc Arm memmap to configure app
This allows us to keep all in one place and fix (removing this function later)
1 parent 8be5da2 commit 207dcbb

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ endif()
136136

137137
#
138138
# Configures the application
139+
# Note, this function will be removed in the next revisions
139140
#
140141
function(mbed_configure_app_target target)
141142
# We need to generate a "response file" to pass to the C preprocessor because of path length
@@ -146,6 +147,16 @@ function(mbed_configure_app_target target)
146147
# using global properties.
147148
mbed_generate_options_for_linker(${target} LINKER_PREPROCESS_DEFINITIONS)
148149
set_property(GLOBAL PROPERTY COMPILE_DEFS_RESPONSE_FILE ${LINKER_PREPROCESS_DEFINITIONS})
150+
151+
# Gcc Arm requires memap to be set with app name, equally to ARMClang
152+
# TODO: move this to toolchain and set properly
153+
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
154+
message(${target})
155+
target_link_options(mbed-core
156+
INTERFACE
157+
"-Wl,-Map=${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map"
158+
)
159+
endif()
149160
endfunction()
150161

151162
#

tools/cmake/set_linker_script.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ function(mbed_set_linker_script input_target raw_linker_script_path)
3535
set(LinkerScriptTarget ${input_target}LinkerScript)
3636
add_custom_target(${LinkerScriptTarget} DEPENDS ${LINKER_SCRIPT_PATH} VERBATIM)
3737
add_dependencies(${input_target} ${LinkerScriptTarget})
38-
# We hardcore mmemory file to "application"
3938
target_link_options(${input_target}
4039
INTERFACE
41-
"-T" "${LINKER_SCRIPT_PATH}"
42-
"-Wl,-Map=${CMAKE_BINARY_DIR}/application${CMAKE_EXECUTABLE_SUFFIX}.map"
40+
"-T" "${LINKER_SCRIPT_PATH}"
4341
)
4442
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
4543
target_link_options(${input_target}

0 commit comments

Comments
 (0)