Also update ARM.cmake

pull/13987/head
Jamie Smith 2020-11-30 16:03:35 -08:00
parent 78be77ee5a
commit 6da2cbb59e
1 changed files with 25 additions and 33 deletions

View File

@ -8,11 +8,13 @@ set(CMAKE_AR "armar")
set(ARM_ELF2BIN "fromelf") set(ARM_ELF2BIN "fromelf")
set_property(GLOBAL PROPERTY ELF2BIN ${ARM_ELF2BIN}) set_property(GLOBAL PROPERTY ELF2BIN ${ARM_ELF2BIN})
# tell cmake about compiler targets.
# This will cause it to add the --target flag.
set(CMAKE_C_COMPILER_TARGET arm-arm-none-eabi)
set(CMAKE_CXX_COMPILER_TARGET arm-arm-none-eabi)
# Sets toolchain options # Sets toolchain options
function(mbed_set_toolchain_options target)
list(APPEND common_options list(APPEND common_options
"-c"
"--target=arm-arm-none-eabi"
"-mthumb" "-mthumb"
"-Wno-armcc-pragma-push-pop" "-Wno-armcc-pragma-push-pop"
"-Wno-armcc-pragma-anon-unions" "-Wno-armcc-pragma-anon-unions"
@ -24,32 +26,22 @@ function(mbed_set_toolchain_options target)
"-fshort-wchar" "-fshort-wchar"
) )
target_compile_options(${target} list(APPEND asm_compile_options
INTERFACE -masm=auto
$<$<COMPILE_LANGUAGE:C>:${common_options}> --target=arm-arm-none-eabi
) )
target_compile_options(${target} list(APPEND link_options
INTERFACE "--map"
$<$<COMPILE_LANGUAGE:CXX>:${common_options}>
)
target_compile_options(${target}
INTERFACE
$<$<COMPILE_LANGUAGE:ASM>:--target=arm-arm-none-eabi -masm=auto>
) )
# Add linking time preprocessor macro for TFM targets # Add linking time preprocessor macro for TFM targets
if(MBED_CPU_CORE MATCHES "\-NS$") if(MBED_CPU_CORE MATCHES "-NS$")
list(APPEND link_options
"--predefine=\"-DDOMAIN_NS=0x1\""
) )
endif() endif()
target_link_options(${target} function(mbed_set_toolchain_options target)
INTERFACE # blank for ARMClang
${link_options}
)
endfunction() endfunction()
# Configure the toolchain to select the selected C library # Configure the toolchain to select the selected C library