mirror of https://github.com/ARMmbed/mbed-os.git
CMake: Create separate function to set MCU core compile defintions
The new function (mbed_set_cpu_core_definitions()) should always be called as it has defintions needed by Mbed OS to work with that particular MCU core. mbed_set_cpu_core_options() should only be called if a third-party toolchain file has not been used as it has compile options that can cause conflicts.pull/13566/head
parent
76f4953688
commit
46c35965c5
|
|
@ -39,7 +39,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-A9"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_A9
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M0plus"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M0PLUS
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"-cpu=Cortex-M0"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M0
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M1"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M3
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M23"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M23
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M23"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M23
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M3"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M3
|
||||
|
|
|
|||
|
|
@ -36,7 +36,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M33.no_dsp.no_fp"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M33
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M33.no_dsp.no_fp"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M33
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M33.no_dsp"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M33
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M33.no_dsp"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M33
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M33"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M33
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M33"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M33
|
||||
|
|
|
|||
|
|
@ -36,7 +36,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M4.no_fp"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M4
|
||||
|
|
|
|||
|
|
@ -3,15 +3,6 @@
|
|||
|
||||
# Sets cpu core options
|
||||
function(mbed_set_cpu_core_options target mbed_toolchain)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M4
|
||||
ARM_MATH_CM4
|
||||
__FPU_PRESENT=1
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
||||
if(${mbed_toolchain} STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
|
|
@ -49,3 +40,14 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M4
|
||||
ARM_MATH_CM4
|
||||
__FPU_PRESENT=1
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
endfunction()
|
||||
|
|
|
|||
|
|
@ -36,7 +36,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M7.no_fp"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M7
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M7.fp.sp"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M7
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ function(mbed_set_cpu_core_options target mbed_toolchain)
|
|||
"--cpu=Cortex-M7"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mbed_set_cpu_core_definitions target)
|
||||
target_compile_definitions(${target}
|
||||
INTERFACE
|
||||
__CORTEX_M7
|
||||
|
|
|
|||
Loading…
Reference in New Issue