|
1 | 1 | # Copyright (c) 2020 ARM Limited. All rights reserved. |
2 | 2 | # SPDX-License-Identifier: Apache-2.0 |
3 | 3 |
|
4 | | -# Sets cpu core options |
5 | | -function(mbed_set_cpu_core_options target mbed_toolchain) |
6 | | - if(${mbed_toolchain} STREQUAL "GCC_ARM") |
7 | | - list(APPEND common_toolchain_options |
8 | | - "-mthumb-interwork" |
9 | | - "-marm" |
10 | | - "-march=armv7-a" |
11 | | - "-mfpu=vfpv3" |
12 | | - "-mfloat-abi=hard" |
13 | | - "-mno-unaligned-access" |
14 | | - ) |
15 | | - |
16 | | - target_compile_options(${target} |
17 | | - INTERFACE |
18 | | - ${common_toolchain_options} |
19 | | - ) |
20 | | - |
21 | | - target_link_options(${target} |
22 | | - INTERFACE |
23 | | - ${common_toolchain_options} |
24 | | - ) |
25 | | - elseif(${mbed_toolchain} STREQUAL "ARM") |
26 | | - list(APPEND compile_options |
27 | | - "-mcpu=cortex-a9" |
28 | | - ) |
29 | | - |
30 | | - target_compile_options(${target} |
31 | | - INTERFACE |
32 | | - $<$<COMPILE_LANGUAGE:C>:${compile_options}> |
33 | | - $<$<COMPILE_LANGUAGE:CXX>:${compile_options}> |
34 | | - $<$<COMPILE_LANGUAGE:ASM>:-mcpu=Cortex-A9> |
35 | | - ) |
36 | | - |
37 | | - target_link_options(${target} |
38 | | - INTERFACE |
39 | | - "--cpu=Cortex-A9" |
40 | | - ) |
41 | | - endif() |
42 | | -endfunction() |
| 4 | +if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") |
| 5 | + list(APPEND common_options |
| 6 | + "-mthumb-interwork" |
| 7 | + "-marm" |
| 8 | + "-march=armv7-a" |
| 9 | + "-mfpu=vfpv3" |
| 10 | + "-mfloat-abi=hard" |
| 11 | + "-mno-unaligned-access" |
| 12 | + ) |
| 13 | +elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") |
| 14 | + list(APPEND c_cxx_compile_options |
| 15 | + "-mcpu=cortex-a9" |
| 16 | + ) |
| 17 | + list(APPEND asm_compile_options |
| 18 | + "-mcpu=Cortex-A9" |
| 19 | + ) |
| 20 | + list(APPEND link_options |
| 21 | + "--cpu=Cortex-A9" |
| 22 | + ) |
| 23 | +endif() |
43 | 24 |
|
44 | 25 | function(mbed_set_cpu_core_definitions target) |
45 | 26 | target_compile_definitions(${target} |
|
0 commit comments