Merge pull request #14185 from hugueskamba/hk_cmake_fix_arm_mcu_core_flags

CMake: Correct ARM toolchain MCU core flags
pull/14188/head
Martin Kojtal 2021-01-25 07:47:38 +00:00 committed by GitHub
commit e7cd244d11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 15 additions and 105 deletions

View File

@ -11,15 +11,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mno-unaligned-access" "-mno-unaligned-access"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-a9" "-mcpu=cortex-a9"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-A9"
)
list(APPEND link_options
"--cpu=Cortex-A9"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mcpu=cortex-m0plus" "-mcpu=cortex-m0plus"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m0plus" "-mcpu=cortex-m0plus"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M0plus"
)
list(APPEND link_options
"--cpu=Cortex-M0plus"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mcpu=cortex-m0" "-mcpu=cortex-m0"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m0" "-mcpu=cortex-m0"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M0"
)
list(APPEND link_options
"--cpu=Cortex-M0"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mthumb" "-mthumb"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m1" "-mcpu=cortex-m1"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M1"
)
list(APPEND link_options
"--cpu=Cortex-M1"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mthumb" "-mthumb"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m23" "-mcpu=cortex-m23"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M23"
)
list(APPEND link_options
"--cpu=Cortex-M23"
)
endif() endif()

View File

@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mthumb" "-mthumb"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m23" "-mcpu=cortex-m23"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M23"
)
list(APPEND link_options
"--cpu=Cortex-M23"
)
endif() endif()

View File

@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mcpu=cortex-m3" "-mcpu=cortex-m3"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m3" "-mcpu=cortex-m3"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M3"
)
list(APPEND link_options
"--cpu=Cortex-M3"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-march=armv8-m.main" "-march=armv8-m.main"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m33+nodsp" "-mcpu=cortex-m33+nodsp"
"-mfpu=fpv5-sp-d16" "-mfpu=fpv5-sp-d16"
"-mfloat-abi=hard" "-mfloat-abi=hard"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M33.no_dsp"
)
list(APPEND link_options
"--cpu=Cortex-M33.no_dsp"
)
endif() endif()

View File

@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-march=armv8-m.main" "-march=armv8-m.main"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m33+nodsp" "-mcpu=cortex-m33+nodsp"
"-mfpu=fpv5-sp-d16" "-mfpu=fpv5-sp-d16"
"-mfloat-abi=hard" "-mfloat-abi=hard"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M33.no_dsp"
)
list(APPEND link_options
"--cpu=Cortex-M33.no_dsp"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -10,15 +10,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-march=armv8-m.main+dsp" "-march=armv8-m.main+dsp"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m33" "-mcpu=cortex-m33"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M33"
)
list(APPEND link_options
"--cpu=Cortex-M33"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -10,15 +10,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-march=armv8-m.main+dsp" "-march=armv8-m.main+dsp"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m33" "-mcpu=cortex-m33"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M33"
)
list(APPEND link_options
"--cpu=Cortex-M33"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -8,16 +8,10 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mcpu=cortex-m4" "-mcpu=cortex-m4"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m4" "-mcpu=cortex-m4"
"-mfpu=none" "-mfpu=none"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M4.no_fp"
)
list(APPEND link_options
"--cpu=Cortex-M4.no_fp"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mfloat-abi=softfp" "-mfloat-abi=softfp"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m4" "-mcpu=cortex-m4"
"-mfpu=fpv4-sp-d16" "-mfpu=fpv4-sp-d16"
"-mfloat-abi=hard" "-mfloat-abi=hard"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M4"
)
list(APPEND link_options
"--cpu=Cortex-M4"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -8,16 +8,10 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mcpu=cortex-m7" "-mcpu=cortex-m7"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m7" "-mcpu=cortex-m7"
"-mfpu=none" "-mfpu=none"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M7.no_fp"
)
list(APPEND link_options
"--cpu=Cortex-M7.no_fp"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)

View File

@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
"-mcpu=cortex-m7" "-mcpu=cortex-m7"
) )
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
list(APPEND c_cxx_compile_options list(APPEND common_options
"-mcpu=cortex-m7" "-mcpu=cortex-m7"
"-mfpu=fpv5-d16" "-mfpu=fpv5-d16"
"-mfloat-abi=hard" "-mfloat-abi=hard"
) )
list(APPEND asm_compile_options
"-mcpu=Cortex-M7"
)
list(APPEND link_options
"--cpu=Cortex-M7"
)
endif() endif()
function(mbed_set_cpu_core_definitions target) function(mbed_set_cpu_core_definitions target)