File tree Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ endif()
5454
5555mbed_set_cpu_core_definitions(mbed-core)
5656if (${MBED_TOOLCHAIN_FILE_USED} )
57- mbed_set_toolchain_options(mbed-core)
5857 mbed_set_profile_options(mbed-core ${MBED_TOOLCHAIN} )
5958 mbed_set_c_lib(mbed-core ${MBED_C_LIB} )
6059 mbed_set_printf_lib(mbed-core ${MBED_PRINTF_LIB} )
@@ -134,7 +133,7 @@ function(mbed_set_mbed_target_linker_script target)
134133 if (MBED_TOOLCHAIN STREQUAL "GCC_ARM" )
135134 set (CMAKE_PRE_BUILD_COMMAND
136135 COMMAND "arm-none-eabi-cpp" ${_linker_preprocess_definitions} -x assembler-with-cpp -E -Wp,-P
137- ${mbed_target_linker_script} -o ${CMAKE_BINARY_DIR} /${APP_NAME } .link_script.ld
136+ ${mbed_target_linker_script} -o ${CMAKE_BINARY_DIR} /${target } .link_script.ld
138137
139138 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
140139 BYPRODUCTS "${CMAKE_BINARY_DIR} /${target} .link_script.ld"
Original file line number Diff line number Diff line change @@ -10,8 +10,10 @@ endif()
1010include (${MBED_CONFIG_PATH} /mbed_config.cmake)
1111
1212# Load toolchain file
13- set (MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "" )
14- include (${MBED_PATH} /tools/cmake/toolchain.cmake)
13+ if (NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED)
14+ set (MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "" )
15+ include (${MBED_PATH} /tools/cmake/toolchain.cmake)
16+ endif ()
1517
1618# Specify available build profiles and add options for the selected build profile
1719include (${MBED_PATH} /tools/cmake/profile.cmake)
Original file line number Diff line number Diff line change @@ -37,13 +37,11 @@ list(APPEND link_options
3737
3838# Add linking time preprocessor macro for TFM targets
3939if (MBED_CPU_CORE MATCHES "-NS$" )
40- )
40+ list (APPEND link_options
41+ "--predefine=\" -DDOMAIN_NS=0x1\" "
42+ )
4143endif ()
4244
43- function (mbed_set_toolchain_options target )
44- # blank for ARMClang
45- endfunction ()
46-
4745# Configure the toolchain to select the selected C library
4846function (mbed_set_c_lib target lib_type)
4947 if (${lib_type} STREQUAL "small" )
Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
77set (GCC_ELF2BIN "arm-none-eabi-objcopy" )
88set_property (GLOBAL PROPERTY ELF2BIN ${GCC_ELF2BIN} )
99
10- # Sets toolchain options for a target
11- function (mbed_set_toolchain_options target )
12-
13- endfunction (mbed_set_toolchain_options)
14-
1510# build toolchain flags that get passed to everything (including CMake compiler checks)
1611list (APPEND link_options
1712 "-Wl,--start-group"
You can’t perform that action at this time.
0 commit comments