@@ -8,48 +8,40 @@ set(CMAKE_AR "armar")
88set (ARM_ELF2BIN "fromelf" )
99set_property (GLOBAL PROPERTY ELF2BIN ${ARM_ELF2BIN} )
1010
11- # Sets toolchain options
12- function (mbed_set_toolchain_options target )
13- list (APPEND common_options
14- "-c"
15- "--target=arm-arm-none-eabi"
16- "-mthumb"
17- "-Wno-armcc-pragma-push-pop"
18- "-Wno-armcc-pragma-anon-unions"
19- "-Wno-reserved-user-defined-literal"
20- "-Wno-deprecated-register"
21- "-fdata-sections"
22- "-fno-exceptions"
23- "-fshort-enums"
24- "-fshort-wchar"
25- )
11+ # tell cmake about compiler targets.
12+ # This will cause it to add the --target flag.
13+ set (CMAKE_C_COMPILER_TARGET arm-arm-none-eabi)
14+ set (CMAKE_CXX_COMPILER_TARGET arm-arm-none-eabi)
2615
27- target_compile_options (${target}
28- INTERFACE
29- $<$<COMPILE_LANGUAGE:C>:${common_options} >
16+ # Sets toolchain options
17+ list (APPEND common_options
18+ "-mthumb"
19+ "-Wno-armcc-pragma-push-pop"
20+ "-Wno-armcc-pragma-anon-unions"
21+ "-Wno-reserved-user-defined-literal"
22+ "-Wno-deprecated-register"
23+ "-fdata-sections"
24+ "-fno-exceptions"
25+ "-fshort-enums"
26+ "-fshort-wchar"
3027 )
3128
32- target_compile_options ( ${target}
33- INTERFACE
34- $<$<COMPILE_LANGUAGE:CXX>: ${common_options} >
29+ list ( APPEND asm_compile_options
30+ -masm=auto
31+ -- target =arm-arm-none-eabi
3532 )
3633
37- target_compile_options (${target}
38- INTERFACE
39- $<$<COMPILE_LANGUAGE:ASM>:--target =arm-arm-none-eabi -masm=auto>
34+ list (APPEND link_options
35+ "--map"
4036 )
4137
42- # Add linking time preprocessor macro for TFM targets
43- if (MBED_CPU_CORE MATCHES "\- NS$" )
44- list (APPEND link_options
45- "--predefine=\" -DDOMAIN_NS=0x1\" "
38+ # Add linking time preprocessor macro for TFM targets
39+ if (MBED_CPU_CORE MATCHES "-NS$" )
4640 )
47- endif ()
41+ endif ()
4842
49- target_link_options (${target}
50- INTERFACE
51- ${link_options}
52- )
43+ function (mbed_set_toolchain_options target )
44+ # blank for ARMClang
5345endfunction ()
5446
5547# Configure the toolchain to select the selected C library
0 commit comments