Commit Graph

31468 Commits (f8a02ce5dede9bd4ef7d7e869e845345766dd9c6)

Author SHA1 Message Date
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
Martin Kojtal 4ec13d7bd5 CMake design: update to the latest version of feature-cmake branch (#13614)
We made changes like tools/cmake folder change, removed app.cmake.
2020-11-06 17:25:21 +00:00
Hugues Kamba cac1b25465 CMake: Move modules under tools subdirectory 2020-11-06 17:25:21 +00:00
Hugues Kamba ae60c6557e CMake: Add background and future plans to README (#13589) 2020-11-06 17:25:21 +00:00
Hugues Kamba 043cb37ff5 CMake: Fix DISCO_L475VG_IOT01A ARM toolchain support
Correct location of startup code and linker file.
2020-11-06 17:25:21 +00:00
Hugues Kamba 37dd6d6064 CMake: Fix ARM toolchain configuration
mbed_generate_gcc_options_for_linker is to
be called only when GCC_ARM is selected.
2020-11-06 17:25:21 +00:00
Hugues Kamba e22b19d6db CMake: Fix build failure due to BLE dir changes 2020-11-06 17:25:21 +00:00
Hugues Kamba 042e9c7078 CMake: Remove TOOLCHAIN_ARM_STD dir for TARGET_STM32F439xI 2020-11-06 17:25:21 +00:00
Hugues Kamba 0f7d03ae1c CMake: Revert mbed-trace CMake input source file to match upstream repository (#13590)
As there is currently no mbed-trace library, statements related to that
target have been commented out.
2020-11-06 17:25:20 +00:00
Martin Kojtal 47f61485b8 CMake: Fix GCC_ARM pre-linking stage (#13575)
Make it generic for all targets. It was previously hardcoded for K64F
2020-11-06 17:25:20 +00:00
Hugues Kamba 1b576c3046 CMake: Clean up platform 2020-11-06 17:25:20 +00:00
Hugues Kamba 9b8c5acb99 CMake: Fix build failure due to mbed-trace, mbed-client-randlib, and nanostack dir changes 2020-11-06 17:25:20 +00:00
Martin Kojtal 18cb55a457 CMake: Add information about the current state of support (#13551) 2020-11-06 17:25:20 +00:00
Hugues Kamba 30ec7fa901 CMake: mbed_add_cmake_directory_if_labels checks presence of CMakeLists.txt before adding subdirectory 2020-11-06 17:25:20 +00:00
Martin Kojtal 9d1ae521e8 CMake: 3.18.2 minimum version set
There are fixes in the latest version we need for ARMClang.
2020-11-06 17:25:20 +00:00
Martin Kojtal e7caa8993a CMake: use response files
As Mbed OS is built as whole, we have long paths again. This is known issue with windows. To fix the paths, we need to use response files.

Ninja is special, needs to be forced to use long paths.
2020-11-06 17:25:20 +00:00
Martin Kojtal 8aa4a85b35 CMake: use CMAKE_TOOLCHAIN_FILE
We should define CMAKE_TOOLCHAIN_FILE (as we are providing Mbed OS toolchain file). This fixes
also the issue we had with Unix makefiles where application would be without response files.

For more details, see https://gitlab.kitware.com/cmake/cmake/-/issues/21104

As the Mbed OS toolchain file is included by CMake, we need to have enabling language in the main CMake (can be executed
only once).
2020-11-06 17:25:20 +00:00
Hugues Kamba 44f9d176e8 CMake: Fix build due to hal dir move 2020-11-06 17:25:20 +00:00
Martin Kojtal 0902a17454 CMake ARMClang: use -masm=auto
Auto mode for ASM files. There might be rare cases where this fails, we will fix
them by requesting the component to use gnu syntax for assembly files.
2020-11-06 17:25:20 +00:00
Martin Kojtal 4c89f67b65 CMake cores: fix flag mpcu for asm 2020-11-06 17:25:20 +00:00
Martin Kojtal 3be2d15e2d CMake ARMClang6: use armclang for asm
Fixes the issue of armasm, passing -DMACRO={0,0} - fails to parse.

We use armclang frontend but passing -masm=armasm.
2020-11-06 17:25:20 +00:00
Hugues Kamba a0fbe2947a CMake: Fix build failure due to CMSIS restructure 2020-11-06 17:25:20 +00:00
Martin Kojtal 458ce2adfb Travis: add more examples we should support
Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
2020-11-06 17:25:20 +00:00
Hugues Kamba 0ba05246cc CMake: Fix selection of scatter file and startup file for DISCO_L475_IOT01A 2020-11-06 17:25:20 +00:00
Hugues Kamba 4fc678c30d CMake: Correct file listing for PSA 2020-11-06 17:25:20 +00:00
Hugues Kamba 3ab8179b1e CMake: Add support for K66F 2020-11-06 17:25:20 +00:00
Hugues Kamba ec376fb587 CMake: List missing files in sal-stack-nanostack 2020-11-06 17:25:20 +00:00
Hugues Kamba 0c8cb3134c CMake: Fix build failure due to PSA dir move 2020-11-06 17:25:20 +00:00