Skip to content

Commit e7cd244

Browse files
authored
Merge pull request #14185 from hugueskamba/hk_cmake_fix_arm_mcu_core_flags
CMake: Correct ARM toolchain MCU core flags
2 parents 83c18dd + db189ba commit e7cd244

15 files changed

+15
-105
lines changed

tools/cmake/cores/Cortex-A9.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1111
"-mno-unaligned-access"
1212
)
1313
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
14-
list(APPEND c_cxx_compile_options
14+
list(APPEND common_options
1515
"-mcpu=cortex-a9"
1616
)
17-
list(APPEND asm_compile_options
18-
"-mcpu=Cortex-A9"
19-
)
20-
list(APPEND link_options
21-
"--cpu=Cortex-A9"
22-
)
2317
endif()
2418

2519
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M0+.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mcpu=cortex-m0plus"
99
)
1010
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
11-
list(APPEND c_cxx_compile_options
11+
list(APPEND common_options
1212
"-mcpu=cortex-m0plus"
1313
)
14-
list(APPEND asm_compile_options
15-
"-mcpu=Cortex-M0plus"
16-
)
17-
list(APPEND link_options
18-
"--cpu=Cortex-M0plus"
19-
)
2014
endif()
2115

2216
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M0.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mcpu=cortex-m0"
99
)
1010
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
11-
list(APPEND c_cxx_compile_options
11+
list(APPEND common_options
1212
"-mcpu=cortex-m0"
1313
)
14-
list(APPEND asm_compile_options
15-
"-mcpu=Cortex-M0"
16-
)
17-
list(APPEND link_options
18-
"--cpu=Cortex-M0"
19-
)
2014
endif()
2115

2216
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M1.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
77
"-mthumb"
88
)
99
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
10-
list(APPEND c_cxx_compile_options
10+
list(APPEND common_options
1111
"-mcpu=cortex-m1"
1212
)
13-
list(APPEND asm_compile_options
14-
"-mcpu=Cortex-M1"
15-
)
16-
list(APPEND link_options
17-
"--cpu=Cortex-M1"
18-
)
1913
endif()
2014

2115
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M23-NS.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
77
"-mthumb"
88
)
99
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
10-
list(APPEND c_cxx_compile_options
10+
list(APPEND common_options
1111
"-mcpu=cortex-m23"
1212
)
13-
list(APPEND asm_compile_options
14-
"-mcpu=Cortex-M23"
15-
)
16-
list(APPEND link_options
17-
"--cpu=Cortex-M23"
18-
)
1913
endif()
2014

2115

tools/cmake/cores/Cortex-M23.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
77
"-mthumb"
88
)
99
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
10-
list(APPEND c_cxx_compile_options
10+
list(APPEND common_options
1111
"-mcpu=cortex-m23"
1212
)
13-
list(APPEND asm_compile_options
14-
"-mcpu=Cortex-M23"
15-
)
16-
list(APPEND link_options
17-
"--cpu=Cortex-M23"
18-
)
1913
endif()
2014

2115

tools/cmake/cores/Cortex-M3.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mcpu=cortex-m3"
99
)
1010
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
11-
list(APPEND c_cxx_compile_options
11+
list(APPEND common_options
1212
"-mcpu=cortex-m3"
1313
)
14-
list(APPEND asm_compile_options
15-
"-mcpu=Cortex-M3"
16-
)
17-
list(APPEND link_options
18-
"--cpu=Cortex-M3"
19-
)
2014
endif()
2115

2216
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M33F-NS.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-march=armv8-m.main"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m33+nodsp"
1515
"-mfpu=fpv5-sp-d16"
1616
"-mfloat-abi=hard"
1717
)
18-
list(APPEND asm_compile_options
19-
"-mcpu=Cortex-M33.no_dsp"
20-
)
21-
list(APPEND link_options
22-
"--cpu=Cortex-M33.no_dsp"
23-
)
2418
endif()
2519

2620

tools/cmake/cores/Cortex-M33F.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-march=armv8-m.main"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m33+nodsp"
1515
"-mfpu=fpv5-sp-d16"
1616
"-mfloat-abi=hard"
1717
)
18-
list(APPEND asm_compile_options
19-
"-mcpu=Cortex-M33.no_dsp"
20-
)
21-
list(APPEND link_options
22-
"--cpu=Cortex-M33.no_dsp"
23-
)
2418
endif()
2519

2620
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M33FE-NS.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-march=armv8-m.main+dsp"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m33"
1515
)
16-
list(APPEND asm_compile_options
17-
"-mcpu=Cortex-M33"
18-
)
19-
list(APPEND link_options
20-
"--cpu=Cortex-M33"
21-
)
2216
endif()
2317

2418
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M33FE.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-march=armv8-m.main+dsp"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m33"
1515
)
16-
list(APPEND asm_compile_options
17-
"-mcpu=Cortex-M33"
18-
)
19-
list(APPEND link_options
20-
"--cpu=Cortex-M33"
21-
)
2216
endif()
2317

2418
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M4.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mcpu=cortex-m4"
99
)
1010
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
11-
list(APPEND c_cxx_compile_options
11+
list(APPEND common_options
1212
"-mcpu=cortex-m4"
1313
"-mfpu=none"
1414
)
15-
list(APPEND asm_compile_options
16-
"-mcpu=Cortex-M4.no_fp"
17-
)
18-
list(APPEND link_options
19-
"--cpu=Cortex-M4.no_fp"
20-
)
2115
endif()
2216

2317
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M4F.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-mfloat-abi=softfp"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m4"
1515
"-mfpu=fpv4-sp-d16"
1616
"-mfloat-abi=hard"
1717
)
18-
list(APPEND asm_compile_options
19-
"-mcpu=Cortex-M4"
20-
)
21-
list(APPEND link_options
22-
"--cpu=Cortex-M4"
23-
)
2418
endif()
2519

2620
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M7.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mcpu=cortex-m7"
99
)
1010
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
11-
list(APPEND c_cxx_compile_options
11+
list(APPEND common_options
1212
"-mcpu=cortex-m7"
1313
"-mfpu=none"
1414
)
15-
list(APPEND asm_compile_options
16-
"-mcpu=Cortex-M7.no_fp"
17-
)
18-
list(APPEND link_options
19-
"--cpu=Cortex-M7.no_fp"
20-
)
2115
endif()
2216

2317
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M7FD.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-mcpu=cortex-m7"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m7"
1515
"-mfpu=fpv5-d16"
1616
"-mfloat-abi=hard"
1717
)
18-
list(APPEND asm_compile_options
19-
"-mcpu=Cortex-M7"
20-
)
21-
list(APPEND link_options
22-
"--cpu=Cortex-M7"
23-
)
2418
endif()
2519

2620
function(mbed_set_cpu_core_definitions target)

0 commit comments

Comments
 (0)