Skip to content

Commit

Permalink
Rebase linker script change properly, re-add external toolchain file …
Browse files Browse the repository at this point in the history
…support
  • Loading branch information
multiplemonomials committed Dec 3, 2020
1 parent f07c0cd commit 0972738
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ endif()

mbed_set_cpu_core_definitions(mbed-core)
if(${MBED_TOOLCHAIN_FILE_USED})
mbed_set_toolchain_options(mbed-core)
mbed_set_profile_options(mbed-core ${MBED_TOOLCHAIN})
mbed_set_c_lib(mbed-core ${MBED_C_LIB})
mbed_set_printf_lib(mbed-core ${MBED_PRINTF_LIB})
Expand Down Expand Up @@ -134,7 +133,7 @@ function(mbed_set_mbed_target_linker_script target)
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
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}/${APP_NAME}.link_script.ld
${mbed_target_linker_script} -o ${CMAKE_BINARY_DIR}/${target}.link_script.ld

WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
BYPRODUCTS "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
Expand Down
6 changes: 4 additions & 2 deletions tools/cmake/app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ endif()
include(${MBED_CONFIG_PATH}/mbed_config.cmake)

# Load toolchain file
set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "")
include(${MBED_PATH}/tools/cmake/toolchain.cmake)
if(NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED)
set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "")
include(${MBED_PATH}/tools/cmake/toolchain.cmake)
endif()

# Specify available build profiles and add options for the selected build profile
include(${MBED_PATH}/tools/cmake/profile.cmake)
Expand Down
8 changes: 3 additions & 5 deletions tools/cmake/toolchains/ARM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ list(APPEND link_options

# Add linking time preprocessor macro for TFM targets
if(MBED_CPU_CORE MATCHES "-NS$")
)
list(APPEND link_options
"--predefine=\"-DDOMAIN_NS=0x1\""
)
endif()

function(mbed_set_toolchain_options target)
# blank for ARMClang
endfunction()

# Configure the toolchain to select the selected C library
function(mbed_set_c_lib target lib_type)
if (${lib_type} STREQUAL "small")
Expand Down
5 changes: 0 additions & 5 deletions tools/cmake/toolchains/GCC_ARM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
set(GCC_ELF2BIN "arm-none-eabi-objcopy")
set_property(GLOBAL PROPERTY ELF2BIN ${GCC_ELF2BIN})

# Sets toolchain options for a target
function(mbed_set_toolchain_options target)

endfunction(mbed_set_toolchain_options)

# build toolchain flags that get passed to everything (including CMake compiler checks)
list(APPEND link_options
"-Wl,--start-group"
Expand Down

0 comments on commit 0972738

Please sign in to comment.