Skip to content

Commit a57b892

Browse files
committed
Unify the cores/Cortex-A.cmake
1 parent 6feca90 commit a57b892

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tools/cmake/cores/Cortex-A9.cmake renamed to tools/cmake/cores/Cortex-A.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mfpu=vfpv3"
99
"-mfloat-abi=softfp"
1010
"-mno-unaligned-access"
11-
"-mcpu=cortex-a9"
11+
"-mcpu=${CMAKE_SYSTEM_PROCESSOR}"
1212
)
1313
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
1414
list(APPEND common_options
1515
"-mfpu=vfpv3"
1616
"-mfloat-abi=hard"
17-
"-mcpu=cortex-a9"
17+
"-mcpu=${CMAKE_SYSTEM_PROCESSOR}"
1818
)
1919
endif()
2020

2121
function(mbed_set_cpu_core_definitions target)
2222
target_compile_definitions(${target}
2323
INTERFACE
24-
__CORTEX_A9
25-
ARM_MATH_CA9
24+
__CORTEX_${MBED_CPU_CORE_CODE}
25+
ARM_MATH_C${MBED_CPU_CORE_CODE}
2626
__FPU_PRESENT
2727
__CMSIS_RTOS
2828
__EVAL

tools/cmake/mbed_toolchain.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,14 @@ set(c_cxx_compile_options "") # compile options only for C/CXX
102102
set(asm_compile_options "") # compile options only for ASM
103103

104104
include(toolchains/${MBED_TOOLCHAIN})
105-
include(cores/${MBED_CPU_CORE})
105+
106+
set(MBED_CPU_CORE_TAG ${MBED_CPU_CORE})
107+
if (MBED_CPU_CORE MATCHES "Cortex-A[0-9]+$")
108+
set(MBED_CPU_CORE_TAG "Cortex-A")
109+
string(REPLACE "Cortex-" "" MBED_CPU_CORE_CODE "${MBED_CPU_CORE}")
110+
endif()
111+
112+
include(cores/${MBED_CPU_CORE_TAG})
106113

107114
#converts a list into a string with each of its elements seperated by a space
108115
macro(list_to_space_separated OUTPUT_VAR)# 2nd arg: LIST...

0 commit comments

Comments
 (0)