@@ -8,48 +8,40 @@ set(CMAKE_AR "armar")
8
8
set (ARM_ELF2BIN "fromelf" )
9
9
set_property (GLOBAL PROPERTY ELF2BIN ${ARM_ELF2BIN} )
10
10
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 )
26
15
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"
30
27
)
31
28
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
35
32
)
36
33
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"
40
36
)
41
37
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$" )
46
40
)
47
- endif ()
41
+ endif ()
48
42
49
- target_link_options (${target}
50
- INTERFACE
51
- ${link_options}
52
- )
43
+ function (mbed_set_toolchain_options target )
44
+ # blank for ARMClang
53
45
endfunction ()
54
46
55
47
# Configure the toolchain to select the selected C library
0 commit comments