Skip to content

Commit 9bf6aff

Browse files
committed
CMake: pass predefined macros to ARM toolchain linker
1 parent 80a0a5b commit 9bf6aff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ endfunction()
132132
#
133133
function(mbed_set_mbed_target_linker_script target)
134134
get_property(mbed_target_linker_script GLOBAL PROPERTY MBED_TARGET_LINKER_FILE)
135+
mbed_generate_options_for_linker(${target} _linker_preprocess_definitions)
135136
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
136-
mbed_generate_options_for_linker(${target} _linker_preprocess_definitions)
137137
set(CMAKE_PRE_BUILD_COMMAND
138138
COMMAND "arm-none-eabi-cpp" ${_linker_preprocess_definitions} -x assembler-with-cpp -E -Wp,-P
139139
${mbed_target_linker_script} -o ${CMAKE_BINARY_DIR}/${target}.link_script.ld
@@ -146,6 +146,7 @@ function(mbed_set_mbed_target_linker_script target)
146146
target_link_options(mbed-core
147147
INTERFACE
148148
"--scatter=${mbed_target_linker_script}"
149+
"--predefine=${_linker_preprocess_definitions}"
149150
)
150151
endif()
151152
add_custom_command(

0 commit comments

Comments
 (0)