Commit Graph

31679 Commits (23702ff2b3b1920d03fea0af0bcf8aaef1229850)

Author SHA1 Message Date
Jaeden Amero c95d2b32b1 Don't require too old mbed tools
Don't require too old of a version of mbed-greentea, mbed-host-tests, or
mbed-ls. We conservatively limit the versions to less than 2.0 for now,
in case we'ld like to break backwards compatibility in the future.
2020-11-09 16:11:42 +00:00
Qinghao Shi 776ad7aa90 TEST: update cmake example on ble examples 2020-11-09 15:39:29 +00:00
Hugues Kamba 794e32df74 CMake: Use relative paths to list source files and directories
The absolute path is still required for listing linker
files as they are referenced from a function in the top
level CMake input source file.
2020-11-09 12:32:30 +00:00
Martin Kojtal 22d926fe8a
Merge pull request #13566 from ARMmbed/feature-cmake
CMake: Add initial support
2020-11-09 08:07:03 +00:00
Abbas Bracken Ziad 877436cc29 Replace calls to deprecated functions in the Timer API 2020-11-06 18:00:51 +00:00
Rajkumar Kanagaraj 073ae1d343 CMake: Validate selected application profile (#13856)
Check if the selected application profile is supported by the selected Mbed Target
2020-11-06 17:25:23 +00:00
Hugues Kamba 66f65c0e89 CMake: Fix third party toolchain file suppport
Compile defintions are always included. However, functions that set compile options
are only called if a third party toolchain file is not used
2020-11-06 17:25:23 +00:00
Hugues Kamba 0bf4683f46 CMake: Set compile defintions for supported toolchain at top level input source file
The compile defintions should always be added depending on the
selected toolchain.
mbed_set_toolchain_options() should only be called if a third-party
toolchain file has not been used as it has compile options that can
cause conflicts.
2020-11-06 17:25:23 +00:00
Hugues Kamba 46c35965c5 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.
2020-11-06 17:25:23 +00:00
Rajkumar Kanagaraj 76f4953688 CMake: Remove depth level argument to match map console prints the same depth
and format as old mbed-CLI
2020-11-06 17:25:23 +00:00
Hugues Kamba 3fa52b9312 CMake: Fix Microlib selection (#13871)
As the assembler does not seem to recognise the request to the
linker to use microlib, remove that instruction.
Microlib is still used as the linker selects microlib as a result
of being explicitly asked to do so.
2020-11-06 17:25:23 +00:00
Martin Kojtal d48415cc67 CMake nrf52480: fix startup/linker inclusion 2020-11-06 17:25:23 +00:00
Hugues Kamba e80fa8b715 CMake: Rename Mbed OS path variable for consistency
Rename the CMake variable expected from applications from MBED_ROOT to
MBED_PATH to be consistent with the naming used for the configuration file
(MBED_CONFIG_PATH) also expected from applications.
2020-11-06 17:25:23 +00:00
Ladislas de Toldi 76cf2f7232 Activate ccache for CMake 2020-11-06 17:25:23 +00:00
Martin Kojtal 7a32e42a60 CMake readme: update mbed-tools to 3.4 2020-11-06 17:25:23 +00:00
Martin Kojtal e77c5324eb CMake: 3.19.0 update to fix ARMClang ASM defines 2020-11-06 17:25:23 +00:00
Martin Kojtal 9faeadc522 CMake: ninja reponse files disabled for ARMClang on Windows
Issue https://gitlab.kitware.com/cmake/cmake/-/issues/21093

Until this is fixed, we should disable response files for ARMClang + ninja on Windows.
Other toolchains and host systems should benefit from response files thus not disabling them
completely.

This fixes the issue with not finding includes. It's not trivial to find the root cause, it took me a while to figure out why ARMClang can't find the paths.

I moved the check to Mbed OS main cmake. It should not be in the toolchain file as it is not
related to the toolchain but to generator. We need toolchain properly set up first.

Note, I had to protect setting CMAKE_NINJA_FORCE_RESPONSE_FILE. If I set it to 0, ninja
would still use rsp files so I rather protected it and define that variable only when
required, not always.

Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
2020-11-06 17:25:23 +00:00
Qinghao Shi bf552af039 TEST: use mbed-tools build wrapper replace cmake build commands 2020-11-06 17:25:23 +00:00
Qinghao Shi 3558a7aa0e restrict BLE example only build BLE_LED 2020-11-06 17:25:23 +00:00
Qinghao Shi c391accc1b TEST: fix a bug on example scripts 2020-11-06 17:25:23 +00:00
Qinghao Shi 411ea55716 TEST: add BLE example to cmake example json 2020-11-06 17:25:23 +00:00
Qinghao Shi 0bb812a706 TEST: remove cmake build test from TravisCI 2020-11-06 17:25:23 +00:00
Qinghao Shi 2d67c670b8 TEST: update example scripts for cmake 2020-11-06 17:25:23 +00:00
Martin Kojtal 062bb5faf0 Update CMakeLists.txt
Co-authored-by: Rajkumar Kanagaraj <45570536+rajkan01@users.noreply.github.com>
2020-11-06 17:25:23 +00:00
Martin Kojtal 52bc5b569c CMake: fix the output bin-hex file
$<TARGET_FILE:${target}> is the output from CMake. As it can contain suffix for some toolchains, we can use ${target} instead (output from hex/bin generation).
2020-11-06 17:25:22 +00:00
Rajkumar Kanagaraj 7171f62489 Replace PUBLIC to INTERFACE keyword 2020-11-06 17:25:22 +00:00
Hugues Kamba e0aa49ffcf CMake: Add support for NUCLEO_F303K8
Added the board so it can be used for testing the bare-metal profile on a Mbed 2 board
2020-11-06 17:25:22 +00:00
Martin Kojtal f8a02ce5de Update rtos/CMakeLists.txt
Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
2020-11-06 17:25:22 +00:00
Rajkumar Kanagaraj e7c0d93ad4 CMake: add mbed-os and mbed-baremetal targets
mbed-os consists of mbed-core and mbed-rtos
mbed-baremetal consists of mbed-core

The main change is for mbed-core. Changing from object library to be interface. This way it allows us to do the above to have 2 main targets for users to use.

This should be backward compatible change as mbed-os target we used contains the same files/options as previously set.
2020-11-06 17:25:22 +00:00
Rajkumar Kanagaraj d2be577b01 CMake: split rtos from core target
Add or remove and directories containing source files, header files, and macro definitions that implement RTOS support.
This includes:
- cmsis/CMSIS_5/CMSIS/RTOS2/
- cmsis/device/rtos/
- rtos/source/ConditionVariable.cpp
- rtos/source/Thread.cpp
2020-11-06 17:25:22 +00:00
Hugues Kamba 2bab2ba038 CMake: Create a mbed-os alias library
This ensures that applications which link with the mbed-os
CMake target still work. We want applications that require the OS
to use the mbed-os CMake target as we will be creating a new one
that will include mbed-core and mbed-rtos.
2020-11-06 17:25:22 +00:00
Hugues Kamba bf84a5b329 CMake: Rename CMake targets
* mbed-os renamed mbed-core
* mbed-os-<COMPONENT> renamed mbed-<COMPONENT>
2020-11-06 17:25:22 +00:00
Martin Kojtal c9cacaf080 CMake: fix application config
These settings like enable_language should be done in the application and just once.
We hit the issue when you expose sources to an app (interface or public), CMake errors as some of the internal settings have not been configured.
2020-11-06 17:25:22 +00:00
Martin Kojtal e0eee75eaf CMake: remove TODO as it is not valid anymore 2020-11-06 17:25:22 +00:00
Rajkumar Kanagaraj a42ad9dea4 Update CMake based on new STM32L4 directory structure 2020-11-06 17:25:22 +00:00
Martin Kojtal d283e69c99 CMake: fix for Gcc Arm preprocessing linker file
A linker script needs symbols (stack size, app size, etc). They are basic values or defines. Not any array like or string like macros. We should filter these, as they are not valid anyway.

The other option to fix this would be to fix all the macros but I dont think it is needed as these config values won't be used in the linker script anyway.

Not allowed in ld files macros with spaces, like MACRO={0, 2, 3} or MACRO=(4 * 2000).
2020-11-06 17:25:22 +00:00
Hugues Kamba c82e8c2337 CMake: Restore rtos api and netsocket presence macro names
The old tools rely on the old names to build
2020-11-06 17:25:22 +00:00
Martin Kojtal 448986feb6 CMake: remove string.h in STM32 usb, already included (#13773) 2020-11-06 17:25:22 +00:00
Hugues Kamba 0ddc75a8f6 CMake: Fix BLE private address linker error
List newly added files in CMake input source files.
2020-11-06 17:25:22 +00:00
Martin Kojtal 662e32ffb7 CMake: Fix travis fetch PR (#13763)
Either fetch TRAVIS_COMMIT or the entire pull request (depending on the TRAVIS_PULL_REQUEST environment variable).
2020-11-06 17:25:21 +00:00
Hugues Kamba 8328963a67 CMake: Replace tested BLE application in CI description
BLE_Button, which was the previously tested BLE example, is
being removed in mbed-os-example-ble. Replace it with BLE_LED.
2020-11-06 17:25:21 +00:00
Martin Kojtal 8529e88e61 cmake: fix present inclusion
We use only _PRESENT macros for components if they are enabled. Use the same in
the mbed.h file or anywhere else.
2020-11-06 17:25:21 +00:00
Rajkumar Kanagaraj 8016a53400 CMake: replace usage of the mbed_add_cmake_directory_if_labels() function (#13754)
Directories that start with special prefixes (TARGET_, FEATURE_, COMPONENT_)  are added to the build based on Mbed target configuration from targets.json instead of calling utility function mbed_add_cmake_directory_if_labels().
2020-11-06 17:25:21 +00:00
Hugues Kamba fa98689639 CMake: Componentize Mbed OS into multiple CMake targets (#13732)
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.

Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
2020-11-06 17:25:21 +00:00
Rajkumar Kanagaraj d84baa8fa1 CMake: Add a function to generate executable artifacts with memap (#13695)
- Add linker option to generate map file for GCC_ARM and ARM toolchain
- Add mbed_generate_map_file function to call memap.py (parse the map
file).
- Add mbed_generate_executable function to generate executable artifacts with a memory map table
2020-11-06 17:25:21 +00:00
Hugues Kamba 22dd57b35b CMake: Add support for NUCLEO_F401RE 2020-11-06 17:25:21 +00:00
Hugues Kamba 4c22554bed CMake: Fix TFM targets build
Add linking time pre-processor macro DOMAIN_NS
for TFM targets and TrustZone non secure targets.
2020-11-06 17:25:21 +00:00
Hugues Kamba 0e257b0730 CMake: Fix location of M33 exception handler source file 2020-11-06 17:25:21 +00:00
Hugues Kamba 3b8aba1dce CMake: Add support for printf lib selection 2020-11-06 17:25:21 +00:00
Hugues Kamba 18345795cd CMake: Add support for C lib selection
Configure the selected toolchain for the selected C library
2020-11-06 17:25:21 +00:00