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,48 +8,40 @@ 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 "-mthumb"
"-c" "-Wno-armcc-pragma-push-pop"
"--target=arm-arm-none-eabi" "-Wno-armcc-pragma-anon-unions"
"-mthumb" "-Wno-reserved-user-defined-literal"
"-Wno-armcc-pragma-push-pop" "-Wno-deprecated-register"
"-Wno-armcc-pragma-anon-unions" "-fdata-sections"
"-Wno-reserved-user-defined-literal" "-fno-exceptions"
"-Wno-deprecated-register" "-fshort-enums"
"-fdata-sections" "-fshort-wchar"
"-fno-exceptions"
"-fshort-enums"
"-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} # Add linking time preprocessor macro for TFM targets
INTERFACE if(MBED_CPU_CORE MATCHES "-NS$")
$<$<COMPILE_LANGUAGE:ASM>:--target=arm-arm-none-eabi -masm=auto>
)
# Add linking time preprocessor macro for TFM targets
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