Skip to content

Remove multiply defined symbol from kvstore/securestore/mbed_lib.json #13312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
3c8a8e7
cmake: add Mbed OS basic cmake
0xc0170 Feb 28, 2020
f478a7b
cmake: add design doc
0xc0170 Mar 2, 2020
e99fb91
cmake doc: fixing some words, still missing how to build paths
0xc0170 Mar 2, 2020
b08d0af
cmake doc: update static vs dynamic cmakes
0xc0170 Mar 3, 2020
cc7bcfd
add cmake lists to common folders + k64f target files
0xc0170 Mar 4, 2020
c5967f6
cmake: add events cmake
0xc0170 Mar 4, 2020
383f2df
cmake: use project_name
0xc0170 Mar 4, 2020
6dea604
Revert "cmake: use project_name"
0xc0170 Mar 4, 2020
4a15e22
cmsis: use mbed-os project
0xc0170 Mar 4, 2020
486085a
rtos: fix cortex target path
0xc0170 Mar 4, 2020
f717901
platform: add cmake
0xc0170 Mar 4, 2020
874c97f
cmake: fix hyphen in project name, using _
0xc0170 Mar 4, 2020
44bc2e8
event: fix source path
0xc0170 Mar 4, 2020
b4629dd
hal: fix flash data extension
0xc0170 Mar 4, 2020
754205b
cmake: fix usb path
0xc0170 Mar 4, 2020
79e73e8
cmake: fix paths and remove linker
0xc0170 Mar 4, 2020
eaeb656
cmake: fix more paths
0xc0170 Mar 4, 2020
67ed7cc
add include for mbed.h
0xc0170 Mar 4, 2020
26a881b
Revert "add include for mbed.h"
0xc0170 Mar 4, 2020
e2bc293
add include paths
0xc0170 Mar 4, 2020
33207a1
cmake: fix comment for baremetal, + rtos
0xc0170 Mar 5, 2020
4a91632
cmake: use . for mbed.h, and define lib as STATIC for now..
0xc0170 Mar 5, 2020
4843285
cmake: req bumped for features we use
0xc0170 Mar 5, 2020
fa09518
cmake: remove duplication, keep it only source oriented
0xc0170 Mar 5, 2020
6d6d9e0
cmake: target sources set to PRIVATE, dont copy within mbed_os
0xc0170 Mar 5, 2020
200711b
cmake: clean-up the cmake
0xc0170 Mar 5, 2020
e9ee5e0
cmake: rtos should be under the condition - add TODO
0xc0170 Mar 6, 2020
ca95975
cmake: add TARGET_ k64f keys
0xc0170 Mar 9, 2020
75f6818
cmake: add TARGET_ function to use in CMake
0xc0170 Mar 9, 2020
3946a0c
cmake: add function to get TARGET/FEATURE etc
0xc0170 Mar 9, 2020
c6b6c85
k64f: fix frdm selection based on TARGET_ label
0xc0170 Mar 9, 2020
29abae1
cmake: add TOOLCHAIN variable and choose proper startup
0xc0170 Mar 9, 2020
17a9993
k64f: fix one conditional selection in cmake
0xc0170 Mar 9, 2020
dcdd972
cmake: add empty feature/component keys list for illustration
0xc0170 Mar 9, 2020
cd29b5f
cmake: add note to rtos , we need this from tools
0xc0170 Mar 9, 2020
6a5a0af
Create a boilerplate and move things around
bulislaw Mar 10, 2020
ae66cfa
cmsis: fix target CORTEX_M
0xc0170 Mar 16, 2020
36bfb53
cmsis: fix compiler inclusion
0xc0170 Mar 16, 2020
1782934
cmsis: add RTE header file
0xc0170 Mar 16, 2020
db62d0a
cmake: move toolchain flag to toolchain gcc file
0xc0170 Mar 16, 2020
9558436
cmake: add rtx5 cmake file
0xc0170 Mar 16, 2020
166e255
cmake: add RTX toolchain/core logic
0xc0170 Mar 16, 2020
33bd9c1
cmake: rtx toolchain fix
0xc0170 Mar 16, 2020
089d4c7
rtos: fix including assembly based on toolchain set
0xc0170 Mar 17, 2020
111e43f
k64f: fix assembly inclusion
0xc0170 Mar 17, 2020
0d5a8ba
k64f: fix function name
0xc0170 Mar 17, 2020
efe675b
cmake: remove unused core variable
0xc0170 Mar 17, 2020
89836b7
cmake: rename KEYWORD to PREFIX
hugueskamba Jun 4, 2020
aa5fc56
cmake: use set_property for global symbols
hugueskamba Jun 4, 2020
ceee19c
cmake: k64f linker script auto set via property
hugueskamba Jun 4, 2020
94855e7
cmake: remove invalid todo
hugueskamba Jun 4, 2020
7ad8537
cmake: sys libs should come via cmake flags
0xc0170 Mar 17, 2020
8cdaecd
toolchain cmake: fix the comment in the proper place where it could b…
hugueskamba Jun 4, 2020
300abc6
cmake: make app generic
0xc0170 Mar 17, 2020
77179c7
cmake: fix formatting in pre/post build
0xc0170 Mar 17, 2020
daca0a3
cmake target: move target definitions
0xc0170 Mar 17, 2020
9324794
cmake gcc: add comment for flags, need to be generated
0xc0170 Mar 17, 2020
d94b0e2
cmake: simplify cmake_directory function, always use labels internally
0xc0170 Mar 17, 2020
b2cde0e
create util.cmake for more common functionality
0xc0170 Mar 17, 2020
6641f74
cmake: move system to env.cmake
0xc0170 Mar 17, 2020
688dc78
remove cmakelist not used
hugueskamba Jun 4, 2020
0e4160b
cmake: fix one license header
0xc0170 Mar 17, 2020
1472f42
platform cmake: fix handler based on toolchain
0xc0170 Mar 17, 2020
1c0f469
cmake: get components via component list
0xc0170 Mar 17, 2020
0df263e
cmake: components rename to modules
0xc0170 Mar 17, 2020
fa605ea
cmake: use toolchain.cmake - will be generated
0xc0170 Mar 17, 2020
90e3bb3
cmake: add note for autogenerated cmake
0xc0170 Mar 17, 2020
f6939af
main cmake: add note for tools for config
0xc0170 Mar 18, 2020
940d875
cmake: fix linker script generation, needs better clean up
0xc0170 Mar 18, 2020
4847797
cmake: remove files that are not on master anymore
0xc0170 Mar 19, 2020
817be4c
cmake: enable rtos by default
0xc0170 Mar 19, 2020
f9f0c7f
cmake: get toolchain cmake based on toolchain set
0xc0170 Mar 19, 2020
2ebce91
cmake: formate target_sources
0xc0170 Mar 19, 2020
e4949fc
enable socket example on K64F
ithinuel Mar 17, 2020
0c11d03
fix label resolution for rtx irq handlers
ithinuel Mar 24, 2020
3cab18b
include directories must be public
ithinuel Mar 24, 2020
ab79cff
rtx cmake: add cortex-a handlers
0xc0170 Mar 31, 2020
f904b14
cmsis: add cortex-a files
0xc0170 Mar 31, 2020
9c809ac
Enable KV storage build with CMake
hugueskamba Apr 2, 2020
7dc5f16
Enable little filesystem storage build with CMake
hugueskamba Apr 6, 2020
a4a5cb5
Cmake: Adding support for DISCO_L475VG_IOT01A target
hugueskamba Apr 7, 2020
8145e3a
cmake: Cleanup files and dirs that have been removed
hugueskamba Jun 4, 2020
be3a75a
cmake: Improve K64F support
hugueskamba Jun 4, 2020
e2a7d86
cmake: Fix DISCO_L475VG_IOT01A support
hugueskamba Jun 5, 2020
598faf6
Cmake: rename GCC toolchain to "GCC_ARM"
hugueskamba Jun 5, 2020
0ce5ebb
Cmake: cleanup CMakeLists.txt files
hugueskamba Jun 5, 2020
7a7e407
Set K64F as default target
hugueskamba Jun 10, 2020
0e14534
Cmake: Add ARM toolchain support
hugueskamba Jun 8, 2020
452a49a
Cmake: Add support for cellular feature
hugueskamba Jun 10, 2020
4790d89
CMake: Add support for WIO_3G target
hugueskamba Jun 15, 2020
76aadba
CMake: Fix Mbed TLS
hugueskamba Jun 18, 2020
9e8352e
CMake: Fix LWIP stack
hugueskamba Jun 18, 2020
429b182
CMake: Add support for BLE
hugueskamba Jun 18, 2020
21c365e
CMake: Restore TOOLCHAIN_ARM directory names
hugueskamba Jun 19, 2020
a5a052f
CMake: Fix BLE feature support
hugueskamba Jun 19, 2020
0bc23e8
CMake: Squash target definitions to easily navigate the file
hugueskamba Jun 22, 2020
49c775e
CMake: Add support NFC
hugueskamba Jun 23, 2020
3ecbdf4
CMake: Add support for LoRaWAN
hugueskamba Jun 25, 2020
547cde6
CMake: Add PSA support
hugueskamba Jun 25, 2020
18f189d
CMake: Add support for NRF52840_DK
hugueskamba Jun 10, 2020
a1643e4
CMake: Add support for all components
hugueskamba Jul 3, 2020
c4ba279
cmake app: fix armlink command for preprocessing
0xc0170 Jul 3, 2020
7a27b64
cmake arm: fix linker flags
0xc0170 Jul 3, 2020
189b149
k64f: fix armclang preprocessor in scatter file
0xc0170 Jul 3, 2020
65e418a
cmake arm: fix linking step
0xc0170 Jul 3, 2020
11db26c
cmake arm: add scatter file to link flags
0xc0170 Jul 3, 2020
1564dff
cmake: fix warning caused by quotes, not needed
0xc0170 Jul 6, 2020
044c927
cmake: remove cpu from linker, it comes from system
0xc0170 Jul 6, 2020
c6e57e1
cmake: remove MMD, unused option for cmake clang
0xc0170 Jul 6, 2020
b2e3c9d
cmake: use command line to set target and toolchain
0xc0170 Jul 6, 2020
4f4834c
cmake: cache target/toolchain as string
0xc0170 Jul 6, 2020
055e467
cmake target: remove comments, clear from conditions
0xc0170 Jul 6, 2020
0d07730
cmake: toolchain file to cover all toolchains
0xc0170 Jul 6, 2020
abc0da3
cmake: fix armclang settings after move
0xc0170 Jul 6, 2020
ca641f9
CMake: Fix PSA support
hugueskamba Jul 6, 2020
eb714b5
CMake: Correct mbed-trace support
hugueskamba Jul 6, 2020
3a2e7f1
CMake: Add support for FEATURE_BLE targets
hugueskamba Jul 6, 2020
a5f2f26
CMake: Add support for features/cellular targets
hugueskamba Jul 6, 2020
0ef714c
CMake: Complete support for mbedtls
hugueskamba Jul 8, 2020
fc3d1eb
CMake: Add support for mbed-client-cli
hugueskamba Jul 8, 2020
b7ea3aa
CMake: Add support for mbed-coap
hugueskamba Jul 8, 2020
3a46672
CMake: Complete nanostack support
hugueskamba Jul 8, 2020
2a8fd14
CMake: Complete netsocket support
hugueskamba Jul 9, 2020
12541ea
CMake: Complete storage support
hugueskamba Jul 9, 2020
b347888
CMake: Cleanup platform CMakeLists.txt
hugueskamba Jul 10, 2020
f2b1320
Add profile cmake files
rwalton-arm Jul 10, 2020
d40e202
Remove -mthumb from common.cmake
rwalton-arm Jul 10, 2020
1760184
Add licence identifiers
rwalton-arm Jul 10, 2020
5871ad0
cmake: fix armclang6 errors (#13270)
0xc0170 Jul 10, 2020
465284f
cmake: not using arm anymore
0xc0170 Jul 10, 2020
aeec813
cmake: remove duplicated settings from env
0xc0170 Jul 10, 2020
27af580
cmake: rename modules to components
0xc0170 Jul 10, 2020
a2bef49
CMake: use `MBED_` prefix instead of `MBED_OS`
0xc0170 Jul 13, 2020
7d3b8c2
CMake: remove mbed ignored files
hugueskamba Jul 13, 2020
1f5c198
CMake: fix target and toolchain prefixes MBED_
0xc0170 Jul 13, 2020
557c1ae
CMake: cleanup code files with MBED prefix
0xc0170 Jul 13, 2020
c8b9d1a
Add per-core cmake files
rwalton-arm Jul 9, 2020
7509bf1
move elements generated by the tools to gen_config and remove the nee…
ithinuel Jul 13, 2020
5df4a38
Travis: add cmake tests
0xc0170 Jul 13, 2020
7b88b78
Travis: fix cloning for CMake
0xc0170 Jul 13, 2020
809c4ff
travis: fix the name for cmake tests
0xc0170 Jul 13, 2020
e27c51b
travis: fix cmake install, use pip wheels to get the latest
0xc0170 Jul 13, 2020
1de52be
travis: use --user for installing cmake
0xc0170 Jul 13, 2020
6b0a6d4
travis: cmake - use gcc arm
0xc0170 Jul 13, 2020
a6e4dc4
travis: fetch feature-cmake Mbed OS into example
0xc0170 Jul 13, 2020
fe26f60
travis cmake: use default target to test the build for now
0xc0170 Jul 13, 2020
64dce67
CMake: Correct property names (must be MBED_* instead of MBED_OS_*)
hugueskamba Jul 13, 2020
bd492c6
CMake: Correct how scatter file is passed
hugueskamba Jul 13, 2020
092d218
cmake armclang: fix issue with exceptions (#13302)
0xc0170 Jul 16, 2020
77d50db
Update include statement in app.cmake
rwalton-arm Jul 17, 2020
1edbeff
cmake: Add toolchain-specific cmake files
Patater Jul 13, 2020
7dc72cd
cmake: Add top-level cpu selector cmake file
Patater Jul 13, 2020
a74172e
cmake: Set the CPU core in a way CMake understands
Patater Jul 13, 2020
3400d9e
git: Ignore some CMake artifacts
Patater Jul 13, 2020
9aa52b7
cmake: Add top-level profile selecting cmake file
Patater Jul 13, 2020
ef74a98
cmake: Use STREQUAL instead of strequal
Patater Jul 13, 2020
1335d68
cmake: Fix multi-line string variables
Patater Jul 13, 2020
1421ba6
cmake: Add -D to CPU core definitions
Patater Jul 13, 2020
014fc65
cmake: Add -D to profile definitions
Patater Jul 13, 2020
4a9ded9
cmake: Use pre- and post- build command with ARMC6
Patater Jul 17, 2020
236e576
cmake: Add TOOLCHAIN definitions
Patater Jul 17, 2020
b9d9b01
travis: fix travis build by using mbedtools
0xc0170 Jul 20, 2020
d863054
Merge pull request #13311 from 0xc0170/fix_travis_using_tools
0xc0170 Jul 20, 2020
5488dbe
CMake: Fix build breakage due to dir resturcture on master
hugueskamba Jul 20, 2020
91bb414
travis cmake: fix checkout branch for example
0xc0170 Jul 20, 2020
cfa4ff6
Merge pull request #13315 from 0xc0170/fix_travis_checkout_branch
0xc0170 Jul 20, 2020
e895e21
Remove doubly defined symbol from mbed_lib.json
rwalton-arm Jul 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,8 @@ DELIVERY/

# Directory used to clone and build TF-M
features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_IGNORE/

# CMake
CMakeCache.txt
cmake_install.cmake
CMakeFiles/
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ after_success:
after_failure:
- set_status "failure" "Test failed."

addons:
apt:
packages:
- ninja-build

matrix:
include:
Expand Down Expand Up @@ -100,6 +104,34 @@ matrix:
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*'

- &cmake-build-test
stage: "CMake"
name: "CMake blinky example"
env: NAME=cmake_test
language: python
python: 3.8
install:
# Install gcc
- source_pkg gcc
- arm-none-eabi-gcc --version
- pip install --upgrade cmake
- pip install --upgrade mbed-tools
# We use manual clone, with depth and single branch = the fastest
# Because of this, we need to create .mbed file as the current tools require it
- >-
git clone --depth=1 --single-branch --branch feature-cmake https://github.com/ARMmbed/mbed-os-example-blinky.git;
cd mbed-os-example-blinky;
git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git;
cd mbed-os;
git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge;
git checkout -qf FETCH_HEAD
- >-
cd -;
touch .mbed;
mbedtools configure -t GCC_ARM -m K64F;
mkdir -p build
script:
- cd build && cmake .. -GNinja -DMBED_PROFILE=develop && cmake --build .

### Docs Tests ###
- &docs-vm
Expand Down
41 changes: 41 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SPDX-License-Identifier: Apache-2.0

# This is not the application cmake, only boilerplate for Mbed OS

cmake_minimum_required(VERSION 3.13)

# Using relative paths behavior
if(POLICY CMP0076)
cmake_policy(SET CMP0076 NEW)
endif()

# Create Mbed OS library
add_library(mbed-os OBJECT)

# Include mbed.h and config from generate folder
target_include_directories(mbed-os PUBLIC .)

# Link config from generate folder
# TODO: @mbed-os-tools We need to get this gen_config somehow set up
target_link_libraries(mbed-os PRIVATE gen_config)

# Default build
add_subdirectory(cmsis)
add_subdirectory(components)
add_subdirectory(connectivity)
add_subdirectory(drivers)
add_subdirectory(events)
add_subdirectory(features)
add_subdirectory(hal)
add_subdirectory(platform)
add_subdirectory(rtos)
add_subdirectory(storage)
add_subdirectory(targets)


# Add additional component
get_property(component GLOBAL PROPERTY MBED_COMPONENT)

foreach(module ${component})
add_subdirectory(${module})
endforeach()
85 changes: 85 additions & 0 deletions cmake/app.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# SPDX-License-Identifier: Apache-2.0

include(.mbedbuild/mbed_config.cmake)
include(${MBED_ROOT}/cmake/toolchain.cmake)
include(${MBED_ROOT}/cmake/env.cmake)
include(${MBED_ROOT}/cmake/util.cmake)
include(${MBED_ROOT}/cmake/core.cmake)
include(${MBED_ROOT}/cmake/profile.cmake)

# if the environment does not specify build type, set to Debug
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo"
CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()

# Create application executable
add_executable(app)

# Include Mbed OS main cmake
add_subdirectory(mbed-os)

# Link the example libs
target_link_libraries(app mbed-os gen_config)

# I have to leave this here as linker is processed after mbed-os added, and can't be in toolchain.cmake
# as its global symbol is empty at that stage, this needs more work
# TODO: This property + pre/post should be moved
get_property(linkerfile GLOBAL PROPERTY MBED_TARGET_LINKER_FILE)

# TODO: get project name to inject into ld
# TODO: @mbed-os-tools this pre/post build commands should get details from target + profile
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
# I have to leave this here as linker is processed after mbed-os added, and can't be in toolchain.cmake
# as its global symbol is empty at that stage, this needs more work
# TODO: This property pre/post should be moved
set(CMAKE_PRE_BUILD_COMMAND
COMMAND "arm-none-eabi-cpp" -E -P
-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
-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp
-DMBED_ROM_START=0x0 -DMBED_ROM_SIZE=0x100000 -DMBED_RAM_START=0x20000000
-DMBED_RAM_SIZE=0x30000 -DMBED_RAM1_START=0x1fff0000
-DMBED_RAM1_SIZE=0x10000 -DMBED_BOOT_STACK_SIZE=1024
-DXIP_ENABLE=0
${linkerfile} -o ${CMAKE_CURRENT_BINARY_DIR}/app.link_script.ld

WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/app.link_script.ld"
)
elseif(MBED_TOOLCHAIN STREQUAL "ARMC6")
set(CMAKE_PRE_BUILD_COMMAND COMMAND "")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} --scatter=${linkerfile}")
endif()

# TODO: @mbed-os-tools this pre/post build commands should get details from target + profile
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
set(CMAKE_POST_BUILD_COMMAND
COMMAND ${ELF2BIN} -O binary $<TARGET_FILE:app> $<TARGET_FILE:app>.bin
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:app>.bin"
COMMAND ${ELF2BIN} -O ihex $<TARGET_FILE:app> $<TARGET_FILE:app>.hex
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:app>.hex"
)
elseif(MBED_TOOLCHAIN STREQUAL "ARMC6")
set(CMAKE_POST_BUILD_COMMAND
COMMAND ${ELF2BIN} --bin -o $<TARGET_FILE:app>.bin $<TARGET_FILE:app>
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:app>.bin"
COMMAND ${ELF2BIN} --i32combined -o $<TARGET_FILE:app>.hex $<TARGET_FILE:app>
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:app>.hex"
)
elseif(MBED_TOOLCHAIN STREQUAL "IAR")
set(CMAKE_POST_BUILD_COMMAND
COMMAND ${ELF2BIN} --bin $<TARGET_FILE:app> $<TARGET_FILE:app>.bin
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:app>.bin"
COMMAND ${ELF2BIN} --ihex $<TARGET_FILE:app> $<TARGET_FILE:app>.hex
COMMAND ${CMAKE_COMMAND} -E echo "-- built: $<TARGET_FILE:app>.hex"
)
endif()



# Custom pre/post build steps
add_custom_command(TARGET app PRE_LINK ${CMAKE_PRE_BUILD_COMMAND})
add_custom_command(TARGET app POST_BUILD ${CMAKE_POST_BUILD_COMMAND})
4 changes: 4 additions & 0 deletions cmake/core.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

include(${MBED_ROOT}/cmake/cores/${MBED_CPU_CORE}.cmake)
58 changes: 58 additions & 0 deletions cmake/cores/Cortex-A9.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set(CMAKE_SYSTEM_PROCESSOR cortex-a9)

if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")

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} \
")

elseif(MBED_TOOLCHAIN STREQUAL "ARMC6")

set(ARM_FLAGS " \
--cpu=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} \
${ARM_FLAGS} \
")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
${ARM_FLAGS} \
")

endif()

add_definitions(
-D__CORTEX_A9
-DARM_MATH_CA9
-D__FPU_PRESENT
-D__CMSIS_RTOS
-D__EVAL
-D__MBED_CMSIS_RTOS_CA9
)
52 changes: 52 additions & 0 deletions cmake/cores/Cortex-M0+.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)

if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")

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} \
")

elseif(MBED_TOOLCHAIN STREQUAL "ARMC6")

set(ARM_FLAGS " \
--cpu=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} \
${ARM_FLAGS} \
")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
${ARM_FLAGS} \
")

endif()

add_definitions(
-D__CORTEX_M0PLUS
-DARM_MATH_CM0PLUS
-D__CMSIS_RTOS
-D__MBED_CMSIS_RTOS_CM
)
51 changes: 51 additions & 0 deletions cmake/cores/Cortex-M0.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set(CMAKE_SYSTEM_PROCESSOR cortex-m0)

if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")

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} \
")

elseif(MBED_TOOLCHAIN STREQUAL "ARMC6")

set(ARM_FLAGS " \
--cpu=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} \
${ARM_FLAGS} \
")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} \
${ARM_FLAGS} \
")

endif()

add_definitions(
-D__CORTEX_M0
-DARM_MATH_CM0
-D__CMSIS_RTOS
-D__MBED_CMSIS_RTOS_CM
)
Loading