mirror of https://github.com/ARMmbed/mbed-os.git
CMake: Use modern CMake techniques to set toolchain options
Use target_compile_options(), target_compile_definitions(), and target_link_options() to set toolchain options.pull/13566/head
parent
debffb6dd1
commit
e172eb33c9
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# This is not the application cmake, only boilerplate for Mbed OS
|
||||
# This is the boilerplate for Mbed OS
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ include(${MBED_ROOT}/cmake/profile.cmake)
|
|||
include(${MBED_ROOT}/cmake/env.cmake)
|
||||
include(${MBED_ROOT}/cmake/util.cmake)
|
||||
|
||||
# if the environment does not specify build type, set to Debug
|
||||
# Specify a default build type
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo"
|
||||
CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
|
||||
|
@ -52,7 +52,11 @@ if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
|||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
set(CMAKE_PRE_BUILD_COMMAND COMMAND "")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} --scatter=${linkerfile}")
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--scatter=${linkerfile}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# TODO: @mbed-os-tools this pre/post build commands should get details from target + profile
|
||||
|
|
|
@ -4,55 +4,48 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-a9)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb-interwork"
|
||||
"-marm"
|
||||
"-march=armv7-a"
|
||||
"-mfpu=vfpv3"
|
||||
"-mfloat-abi=hard"
|
||||
"-mno-unaligned-access"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb-interwork \
|
||||
-marm \
|
||||
-march=armv7-a \
|
||||
-mfpu=vfpv3 \
|
||||
-mfloat-abi=hard \
|
||||
-mno-unaligned-access \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-a9"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-a9 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-A9 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-A9 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-A9>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-A9"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_A9
|
||||
-DARM_MATH_CA9
|
||||
-D__FPU_PRESENT
|
||||
-D__CMSIS_RTOS
|
||||
-D__EVAL
|
||||
-D__MBED_CMSIS_RTOS_CA9
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_A9
|
||||
ARM_MATH_CA9
|
||||
__FPU_PRESENT
|
||||
__CMSIS_RTOS
|
||||
__EVAL
|
||||
__MBED_CMSIS_RTOS_CA9
|
||||
)
|
||||
|
|
|
@ -4,49 +4,42 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mcpu=cortex-m0plus"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mcpu=cortex-m0plus \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m0plus"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m0plus \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M0plus \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M0plus \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M0plus>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M0plus"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M0PLUS
|
||||
-DARM_MATH_CM0PLUS
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M0PLUS
|
||||
ARM_MATH_CM0PLUS
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,48 +4,41 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m0)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND options
|
||||
"-mcpu=cortex-m0"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m0 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M0 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M0 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:-cpu=Cortex-M0>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"-cpu=Cortex-M0"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M0
|
||||
-DARM_MATH_CM0
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M0
|
||||
ARM_MATH_CM0
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,48 +4,41 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m1)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND options
|
||||
"-mcpu=cortex-m1"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m1 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M1 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M1 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M1>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M1"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M3
|
||||
-DARM_MATH_CM1
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M3
|
||||
ARM_MATH_CM1
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,48 +4,41 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m23)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m23"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m23 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M23 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M23 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M23>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M23"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M23
|
||||
-DARM_MATH_ARMV8MBL
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M23
|
||||
ARM_MATH_ARMV8MBL
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,49 +4,42 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m23)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m23"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m23 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M23 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M23 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M23>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M23"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M23
|
||||
-DARM_MATH_ARMV8MBL
|
||||
-DDOMAIN_NS=1
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M23
|
||||
ARM_MATH_ARMV8MBL
|
||||
DOMAIN_NS=1
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,48 +4,41 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m3)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m3"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m3 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M3 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M3 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M3>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M3"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M3
|
||||
-DARM_MATH_CM3
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M3
|
||||
ARM_MATH_CM3
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,50 +4,43 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-march=armv8-m.main"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-march=armv8-m.main \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m33+nodsp"
|
||||
"-mfpu=none"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m33+nodsp \
|
||||
-mfpu=none \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M33.no_dsp.no_fp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M33.no_dsp.no_fp \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M33.no_dsp.no_fp>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M33.no_dsp.no_fp"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M33
|
||||
-DARM_MATH_ARMV8MML
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M33
|
||||
ARM_MATH_ARMV8MML
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -3,52 +3,47 @@
|
|||
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
|
||||
|
||||
list(APPEND options)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-march=armv8-m.main"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-march=armv8-m.main \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m33+nodsp"
|
||||
"-mfpu=none"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m33+nodsp \
|
||||
-mfpu=none \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M33.no_dsp.no_fp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M33.no_dsp.no_fp \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M33.no_dsp.no_fp>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M33.no_dsp.no_fp"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M33
|
||||
-DARM_MATH_ARMV8MML
|
||||
-DDOMAIN_NS=1
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M33
|
||||
ARM_MATH_ARMV8MML
|
||||
DOMAIN_NS=1
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,54 +4,47 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mfpu=fpv5-sp-d16"
|
||||
"-mfloat-abi=softfp"
|
||||
"-march=armv8-m.main"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mfpu=fpv5-sp-d16 \
|
||||
-mfloat-abi=softfp \
|
||||
-march=armv8-m.main \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m33+nodsp"
|
||||
"-mfpu=fpv5-sp-d16"
|
||||
"-mfloat-abi=hard"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m33+nodsp \
|
||||
-mfpu=fpv5-sp-d16 \
|
||||
-mfloat-abi=hard \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M33.no_dsp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M33.no_dsp \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M33.no_dsp>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M33.no_dsp"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M33
|
||||
-DARM_MATH_ARMV8MML
|
||||
-D__FPU_PRESENT=1U
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M33
|
||||
ARM_MATH_ARMV8MML
|
||||
__FPU_PRESENT=1U
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,55 +4,48 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mfpu=fpv5-sp-d16"
|
||||
"-mfloat-abi=softfp"
|
||||
"-march=armv8-m.main"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mfpu=fpv5-sp-d16 \
|
||||
-mfloat-abi=softfp \
|
||||
-march=armv8-m.main \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m33+nodsp"
|
||||
"-mfpu=fpv5-sp-d16"
|
||||
"-mfloat-abi=hard"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m33+nodsp \
|
||||
-mfpu=fpv5-sp-d16 \
|
||||
-mfloat-abi=hard \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M33.no_dsp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M33.no_dsp \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M33.no_dsp>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M33.no_dsp"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M33
|
||||
-DARM_MATH_ARMV8MML
|
||||
-DDOMAIN_NS=1
|
||||
-D__FPU_PRESENT=1U
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M33
|
||||
ARM_MATH_ARMV8MML
|
||||
DOMAIN_NS=1
|
||||
__FPU_PRESENT=1U
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,53 +4,46 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mfpu=fpv5-sp-d16"
|
||||
"-mfloat-abi=softfp"
|
||||
"-march=armv8-m.main+dsp"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mfpu=fpv5-sp-d16 \
|
||||
-mfloat-abi=softfp \
|
||||
-march=armv8-m.main+dsp \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m33"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m33 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M33 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M33 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M33>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M33"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M33
|
||||
-DARM_MATH_ARMV8MML
|
||||
-D__FPU_PRESENT=1U
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
-D__DSP_PRESENT=1U
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M33
|
||||
ARM_MATH_ARMV8MML
|
||||
__FPU_PRESENT=1U
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
__DSP_PRESENT=1U
|
||||
)
|
||||
|
|
|
@ -4,54 +4,47 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mfpu=fpv5-sp-d16"
|
||||
"-mfloat-abi=softfp"
|
||||
"-march=armv8-m.main+dsp"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mfpu=fpv5-sp-d16 \
|
||||
-mfloat-abi=softfp \
|
||||
-march=armv8-m.main+dsp \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m33"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m33 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M33 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M33 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M33>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M33"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M33
|
||||
-DARM_MATH_ARMV8MML
|
||||
-DDOMAIN_NS=1
|
||||
-D__FPU_PRESENT=1U
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
-D__DSP_PRESENT=1U
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M33
|
||||
ARM_MATH_ARMV8MML
|
||||
DOMAIN_NS=1
|
||||
__FPU_PRESENT=1U
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
__DSP_PRESENT=1U
|
||||
)
|
||||
|
|
|
@ -4,50 +4,43 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mcpu=cortex-m4"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mcpu=cortex-m4 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m4"
|
||||
"-mfpu=none"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m4 \
|
||||
-mfpu=none \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M4.no_fp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M4.no_fp \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M4.no_fp>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M4.no_fp"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M4
|
||||
-DARM_MATH_CM4
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M4
|
||||
ARM_MATH_CM4
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,54 +4,47 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mcpu=cortex-m4"
|
||||
"-mfpu=fpv4-sp-d16"
|
||||
"-mfloat-abi=softfp"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mcpu=cortex-m4 \
|
||||
-mfpu=fpv4-sp-d16 \
|
||||
-mfloat-abi=softfp \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m4"
|
||||
"-mfpu=fpv4-sp-d16"
|
||||
"-mfloat-abi=hard"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m4 \
|
||||
-mfpu=fpv4-sp-d16 \
|
||||
-mfloat-abi=hard \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M4 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M4 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M4>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M4"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M4
|
||||
-DARM_MATH_CM4
|
||||
-D__FPU_PRESENT=1
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M4
|
||||
ARM_MATH_CM4
|
||||
__FPU_PRESENT=1
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,50 +4,43 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m7)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mcpu=cortex-m7"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mcpu=cortex-m7 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m7"
|
||||
"-mfpu=none"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m7 \
|
||||
-mfpu=none \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M7.no_fp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M7.no_fp \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M7.no_fp>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M7.no_fp"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M7
|
||||
-DARM_MATH_CM7
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M7
|
||||
ARM_MATH_CM7
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,54 +4,47 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m7)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mfpu=fpv5-sp-d16"
|
||||
"-mfloat-abi=softfp"
|
||||
"-mcpu=cortex-m7"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mfpu=fpv5-sp-d16 \
|
||||
-mfloat-abi=softfp \
|
||||
-mcpu=cortex-m7 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m7"
|
||||
"-mfpu=fpv5-sp-d16"
|
||||
"-mfloat-abi=hard"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m7 \
|
||||
-mfpu=fpv5-sp-d16 \
|
||||
-mfloat-abi=hard \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M7.fp.sp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M7.fp.sp \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M7.fp.sp>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M7.fp.sp"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M7
|
||||
-DARM_MATH_CM7
|
||||
-D__FPU_PRESENT=1
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M7
|
||||
ARM_MATH_CM7
|
||||
__FPU_PRESENT=1
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -4,54 +4,47 @@
|
|||
set(CMAKE_SYSTEM_PROCESSOR cortex-m7)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND common_toolchain_options
|
||||
"-mthumb"
|
||||
"-mfpu=fpv5-d16"
|
||||
"-mfloat-abi=softfp"
|
||||
"-mcpu=cortex-m7"
|
||||
)
|
||||
|
||||
set(GCC_FLAGS " \
|
||||
-mthumb \
|
||||
-mfpu=fpv5-d16 \
|
||||
-mfloat-abi=softfp \
|
||||
-mcpu=cortex-m7 \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${GCC_FLAGS} \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_toolchain_options}
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND compile_options
|
||||
"-mcpu=cortex-m7"
|
||||
"-mfpu=fpv5-d16"
|
||||
"-mfloat-abi=hard"
|
||||
)
|
||||
|
||||
set(ARM_FLAGS " \
|
||||
-mcpu=cortex-m7 \
|
||||
-mfpu=fpv5-d16 \
|
||||
-mfloat-abi=hard \
|
||||
")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${ARM_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
--cpu=Cortex-M7 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--cpu=Cortex-M7 \
|
||||
")
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${compile_options}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpu=Cortex-M7>
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
"--cpu=Cortex-M7"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-D__CORTEX_M7
|
||||
-DARM_MATH_CM7
|
||||
-D__FPU_PRESENT=1
|
||||
-D__CMSIS_RTOS
|
||||
-D__MBED_CMSIS_RTOS_CM
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__CORTEX_M7
|
||||
ARM_MATH_CM7
|
||||
__FPU_PRESENT=1
|
||||
__CMSIS_RTOS
|
||||
__MBED_CMSIS_RTOS_CM
|
||||
)
|
||||
|
|
|
@ -1,63 +1,95 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set(DEBUG_DEFINITIONS
|
||||
-DMBED_DEBUG
|
||||
-DMBED_TRAP_ERRORS_ENABLED=1
|
||||
)
|
||||
list(APPEND link_options)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
-c \
|
||||
-g3 \
|
||||
-std=gnu11 \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
-c \
|
||||
-g3 \
|
||||
-std=gnu++14 \
|
||||
-fno-rtti \
|
||||
-Wvla \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
-c \
|
||||
-g3 \
|
||||
-x assembler-with-cpp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
-Wl,--gc-sections \
|
||||
-Wl,--wrap,main \
|
||||
-Wl,--wrap,_malloc_r \
|
||||
-Wl,--wrap,_free_r \
|
||||
-Wl,--wrap,_realloc_r \
|
||||
-Wl,--wrap,_memalign_r \
|
||||
-Wl,--wrap,_calloc_r \
|
||||
-Wl,--wrap,exit \
|
||||
-Wl,--wrap,atexit \
|
||||
-Wl,-n \
|
||||
")
|
||||
list(APPEND c_compile_options
|
||||
"-c"
|
||||
"-std=gnu11"
|
||||
"-g3"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${c_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND cxx_compile_options
|
||||
"-c"
|
||||
"-g3"
|
||||
"-std=gnu++14"
|
||||
"-fno-rtti"
|
||||
"-Wvla"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${cxx_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND asm_compile_options
|
||||
"-c"
|
||||
"-g3"
|
||||
"-x" "assembler-with-cpp"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:ASM>:${asm_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND link_options
|
||||
"-Wl,--gc-sections"
|
||||
"-Wl,--wrap,main"
|
||||
"-Wl,--wrap,_malloc_r"
|
||||
"-Wl,--wrap,_free_r"
|
||||
"-Wl,--wrap,_realloc_r"
|
||||
"-Wl,--wrap,_memalign_r"
|
||||
"-Wl,--wrap,_calloc_r"
|
||||
"-Wl,--wrap,exit"
|
||||
"-Wl,--wrap,atexit"
|
||||
"-Wl,-n"
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
-std=gnu11 \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
-fno-rtti \
|
||||
-fno-c++-static-destructors \
|
||||
-std=gnu++14 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--verbose \
|
||||
--remove \
|
||||
--show_full_path \
|
||||
--legacyalign \
|
||||
--any_contingency \
|
||||
--keep=os_cb_sections \
|
||||
")
|
||||
set(DEBUG_DEFINITIONS ${DEBUG_DEFINITIONS}
|
||||
-D__ASSERT_MSG
|
||||
-DMULADDC_CANNOT_USE_R7
|
||||
list(APPEND c_compile_options
|
||||
"-std=gnu11"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${c_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND cxx_compile_options
|
||||
"-std=gnu++14"
|
||||
"-fno-rtti"
|
||||
"-fno-c++-static-destructors"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${cxx_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND link_options
|
||||
"--verbose"
|
||||
"--remove"
|
||||
"--show_full_path"
|
||||
"--legacyalign"
|
||||
"--any_contingency"
|
||||
"--keep=os_cb_sections"
|
||||
)
|
||||
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__ASSERT_MSG
|
||||
MULADDC_CANNOT_USE_R7
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(${DEBUG_DEFINITIONS})
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
MBED_DEBUG
|
||||
MBED_TRAP_ERRORS_ENABLED=1
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${link_options}
|
||||
)
|
||||
|
|
|
@ -1,57 +1,87 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set(DEVELOP_DEFINITIONS
|
||||
-DMBED_TRAP_ERRORS_ENABLED=1
|
||||
)
|
||||
list(APPEND link_options)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
list(APPEND c_compile_options
|
||||
"-c"
|
||||
"-std=gnu11"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${c_compile_options}>
|
||||
)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
-c \
|
||||
-std=gnu11 \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
-std=gnu++14 \
|
||||
-fno-rtti \
|
||||
-Wvla \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
-x assembler-with-cpp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
-Wl,--gc-sections \
|
||||
-Wl,--wrap,main \
|
||||
-Wl,--wrap,_malloc_r \
|
||||
-Wl,--wrap,_free_r \
|
||||
-Wl,--wrap,_realloc_r \
|
||||
-Wl,--wrap,_memalign_r \
|
||||
-Wl,--wrap,_calloc_r \
|
||||
-Wl,--wrap,exit \
|
||||
-Wl,--wrap,atexit \
|
||||
-Wl,-n \
|
||||
")
|
||||
list(APPEND cxx_compile_options
|
||||
"-std=gnu++14"
|
||||
"-fno-rtti"
|
||||
"-Wvla"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${cxx_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND asm_compile_options
|
||||
"-x" "assembler-with-cpp"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:ASM>:${asm_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND link_options
|
||||
"-Wl,--gc-sections"
|
||||
"-Wl,--wrap,main"
|
||||
"-Wl,--wrap,_malloc_r"
|
||||
"-Wl,--wrap,_free_r"
|
||||
"-Wl,--wrap,_realloc_r"
|
||||
"-Wl,--wrap,_memalign_r"
|
||||
"-Wl,--wrap,_calloc_r"
|
||||
"-Wl,--wrap,exit"
|
||||
"-Wl,--wrap,atexit"
|
||||
"-Wl,-n"
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
-std=gnu11 \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
-fno-rtti \
|
||||
-fno-c++-static-destructors \
|
||||
-std=gnu++14 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--show_full_path \
|
||||
--legacyalign \
|
||||
--inline \
|
||||
--any_contingency \
|
||||
--keep=os_cb_sections \
|
||||
")
|
||||
list(APPEND c_compile_options
|
||||
"-std=gnu11"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${c_compile_options}>
|
||||
)
|
||||
|
||||
set(DEVELOP_DEFINITIONS ${DEVELOP_DEFINITIONS}
|
||||
-D__ASSERT_MSG
|
||||
list(APPEND cxx_compile_options
|
||||
"-std=gnu++14"
|
||||
"-fno-rtti"
|
||||
"-fno-c++-static-destructors"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${cxx_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND link_options
|
||||
"--show_full_path"
|
||||
"--legacyalign"
|
||||
"--inline"
|
||||
"--any_contingency"
|
||||
"--keep=os_cb_sections"
|
||||
)
|
||||
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__ASSERT_MSG
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(${DEVELOP_DEFINITIONS})
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
MBED_TRAP_ERRORS_ENABLED=1
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${link_options}
|
||||
)
|
||||
|
|
|
@ -1,57 +1,89 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set(RELEASE_DEFINITIONS
|
||||
-DNDEBUG
|
||||
)
|
||||
list(APPEND link_options)
|
||||
|
||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
-c \
|
||||
-std=gnu11 \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
-c \
|
||||
-std=gnu++14 \
|
||||
-fno-rtti \
|
||||
-Wvla \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
-c \
|
||||
-x assembler-with-cpp \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
-Wl,--gc-sections \
|
||||
-Wl,--wrap,main \
|
||||
-Wl,--wrap,_malloc_r \
|
||||
-Wl,--wrap,_free_r \
|
||||
-Wl,--wrap,_realloc_r \
|
||||
-Wl,--wrap,_memalign_r \
|
||||
-Wl,--wrap,_calloc_r \
|
||||
-Wl,--wrap,exit \
|
||||
-Wl,--wrap,atexit \
|
||||
-Wl,-n \
|
||||
")
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
-std=gnu11 \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
-fno-rtti \
|
||||
-fno-c++-static-destructors \
|
||||
-std=gnu++14 \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
--show_full_path \
|
||||
--legacyalign \
|
||||
--inline \
|
||||
--any_contingency \
|
||||
--keep=os_cb_sections \
|
||||
")
|
||||
list(APPEND c_compile_options
|
||||
"-c"
|
||||
"-std=gnu11"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${c_compile_options}>
|
||||
)
|
||||
|
||||
set(RELEASE_DEFINITIONS ${RELEASE_DEFINITIONS}
|
||||
-D__ASSERT_MSG
|
||||
list(APPEND cxx_compile_options
|
||||
"-c"
|
||||
"-std=gnu++14"
|
||||
"-fno-rtti"
|
||||
"-Wvla"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${cxx_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND asm_compile_options
|
||||
"-c"
|
||||
"-x" "assembler-with-cpp"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:ASM>:${asm_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND link_options
|
||||
"-Wl,--gc-sections"
|
||||
"-Wl,--wrap,main"
|
||||
"-Wl,--wrap,_malloc_r"
|
||||
"-Wl,--wrap,_free_r"
|
||||
"-Wl,--wrap,_realloc_r"
|
||||
"-Wl,--wrap,_memalign_r"
|
||||
"-Wl,--wrap,_calloc_r"
|
||||
"-Wl,--wrap,exit"
|
||||
"-Wl,--wrap,atexit"
|
||||
"-Wl,-n"
|
||||
)
|
||||
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
|
||||
list(APPEND c_compile_options
|
||||
"-std=gnu11"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${c_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND cxx_compile_options
|
||||
"-std=gnu++14"
|
||||
"-fno-rtti"
|
||||
"-fno-c++-static-destructors"
|
||||
)
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${cxx_compile_options}>
|
||||
)
|
||||
|
||||
list(APPEND link_options
|
||||
"--show_full_path"
|
||||
"--legacyalign"
|
||||
"--inline"
|
||||
"--any_contingency"
|
||||
"--keep=os_cb_sections"
|
||||
)
|
||||
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
__ASSERT_MSG
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(${RELEASE_DEFINITIONS})
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
NDEBUG
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${link_options}
|
||||
)
|
||||
|
|
|
@ -6,35 +6,45 @@ set(CMAKE_C_COMPILER "armclang")
|
|||
set(CMAKE_CXX_COMPILER "armclang")
|
||||
set(CMAKE_AR "armar")
|
||||
set(ELF2BIN "fromelf")
|
||||
set(COMMON_FLAGS " \
|
||||
${MBED_STUDIO_ARM_COMPILER} \
|
||||
-c \
|
||||
--target=arm-arm-none-eabi \
|
||||
-Oz \
|
||||
-Wno-armcc-pragma-push-pop \
|
||||
-Wno-armcc-pragma-anon-unions \
|
||||
-Wno-reserved-user-defined-literal \
|
||||
-Wno-deprecated-register \
|
||||
-fdata-sections \
|
||||
-fno-exceptions \
|
||||
-fshort-enums \
|
||||
-fshort-wchar \
|
||||
")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${COMMON_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${COMMON_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${MBED_STUDIO_ARM_COMPILER} \
|
||||
--cpreproc \
|
||||
--cpreproc_opts=--target=arm-arm-none-eabi,-mcpu=cortex-m4,-D,__FPU_PRESENT,-D,MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${MBED_STUDIO_ARM_COMPILER} \
|
||||
")
|
||||
|
||||
add_definitions(
|
||||
-DTOOLCHAIN_ARM
|
||||
list(APPEND common_options
|
||||
"${MBED_STUDIO_ARM_COMPILER}"
|
||||
"-c"
|
||||
"--target=arm-arm-none-eabi"
|
||||
"-Oz"
|
||||
"-Wno-armcc-pragma-push-pop"
|
||||
"-Wno-armcc-pragma-anon-unions"
|
||||
"-Wno-reserved-user-defined-literal"
|
||||
"-Wno-deprecated-register"
|
||||
"-fdata-sections"
|
||||
"-fno-exceptions"
|
||||
"-fshort-enums"
|
||||
"-fshort-wchar"
|
||||
)
|
||||
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:C>:${common_options}>
|
||||
)
|
||||
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${common_options}>
|
||||
)
|
||||
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
$<$<COMPILE_LANGUAGE:ASM>:${MBED_STUDIO_ARM_COMPILER}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpreproc>
|
||||
$<$<COMPILE_LANGUAGE:ASM>:--cpreproc_opts=--target=arm-arm-none-eabi,-mcpu=cortex-m4,-D,__FPU_PRESENT,-D,MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED>
|
||||
)
|
||||
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
TOOLCHAIN_ARM
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${MBED_STUDIO_ARM_COMPILER}
|
||||
)
|
||||
|
|
|
@ -5,49 +5,49 @@ set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc")
|
|||
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
|
||||
set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
|
||||
set(ELF2BIN "arm-none-eabi-objcopy")
|
||||
set(LD_SYS_LIBS " \
|
||||
-Wl,--start-group \
|
||||
-lstdc++ \
|
||||
-lsupc++ \
|
||||
-lm \
|
||||
-lc \
|
||||
-lgcc \
|
||||
-lnosys \
|
||||
-Wl,--end-group \
|
||||
")
|
||||
set(COMMON_FLAGS " \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
-fmessage-length=0 \
|
||||
-fno-exceptions \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-funsigned-char \
|
||||
-MMD \
|
||||
-fomit-frame-pointer \
|
||||
-Os \
|
||||
-g \
|
||||
")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
${COMMON_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
${COMMON_FLAGS} \
|
||||
")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} \
|
||||
${COMMON_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${COMMON_FLAGS} \
|
||||
")
|
||||
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
|
||||
${LD_SYS_LIBS} \
|
||||
-T ${CMAKE_BINARY_DIR}/app.link_script.ld \
|
||||
")
|
||||
|
||||
add_definitions(
|
||||
-DTOOLCHAIN_GCC_ARM
|
||||
-DTOOLCHAIN_GCC
|
||||
list(APPEND link_options
|
||||
"-Wl,--start-group"
|
||||
"-lstdc++"
|
||||
"-lsupc++"
|
||||
"-lm"
|
||||
"-lc"
|
||||
"-lgcc"
|
||||
"-lnosys"
|
||||
"-Wl,--end-group"
|
||||
"-T"
|
||||
"${CMAKE_BINARY_DIR}/app.link_script.ld"
|
||||
)
|
||||
|
||||
list(APPEND common_options
|
||||
"-Wall"
|
||||
"-Wextra"
|
||||
"-Wno-unused-parameter"
|
||||
"-Wno-missing-field-initializers"
|
||||
"-fmessage-length=0"
|
||||
"-fno-exceptions"
|
||||
"-ffunction-sections"
|
||||
"-fdata-sections"
|
||||
"-funsigned-char"
|
||||
"-MMD"
|
||||
"-fomit-frame-pointer"
|
||||
"-Os"
|
||||
"-g"
|
||||
)
|
||||
|
||||
target_compile_options(mbed-os
|
||||
PUBLIC
|
||||
${common_options}
|
||||
)
|
||||
|
||||
target_compile_definitions(mbed-os
|
||||
PUBLIC
|
||||
TOOLCHAIN_GCC_ARM
|
||||
TOOLCHAIN_GCC
|
||||
)
|
||||
|
||||
target_link_options(mbed-os
|
||||
PUBLIC
|
||||
${common_options}
|
||||
${link_options}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue