mirror of https://github.com/ARMmbed/mbed-os.git
CMake: pass predefined macros to ARM toolchain linker
parent
80a0a5b440
commit
9bf6affc74
|
@ -132,8 +132,8 @@ endfunction()
|
|||
#
|
||||
function(mbed_set_mbed_target_linker_script target)
|
||||
get_property(mbed_target_linker_script GLOBAL PROPERTY MBED_TARGET_LINKER_FILE)
|
||||
mbed_generate_options_for_linker(${target} _linker_preprocess_definitions)
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
mbed_generate_options_for_linker(${target} _linker_preprocess_definitions)
|
||||
set(CMAKE_PRE_BUILD_COMMAND
|
||||
COMMAND "arm-none-eabi-cpp" ${_linker_preprocess_definitions} -x assembler-with-cpp -E -Wp,-P
|
||||
${mbed_target_linker_script} -o ${CMAKE_BINARY_DIR}/${target}.link_script.ld
|
||||
|
@ -146,6 +146,7 @@ function(mbed_set_mbed_target_linker_script target)
|
|||
target_link_options(mbed-core
|
||||
INTERFACE
|
||||
"--scatter=${mbed_target_linker_script}"
|
||||
"--predefine=${_linker_preprocess_definitions}"
|
||||
)
|
||||
endif()
|
||||
add_custom_command(
|
||||
|
|
Loading…
Reference in New Issue