Commit Graph

146 Commits (72031258279144ba0133d6390503dc692b122d88)

Author SHA1 Message Date
Jamie Smith f07c0cd7e6 Fix variable name conflict with toolchain file 2020-12-03 10:58:41 -08:00
Jamie Smith bb7391a37b Remove core.cmake 2020-12-03 10:58:15 -08:00
Jamie Smith 6da2cbb59e Also update ARM.cmake 2020-12-03 10:58:14 -08:00
Jamie Smith 78be77ee5a Change toolchain file to load core and toolchain options *before* compilers are loaded. 2020-12-03 10:57:23 -08:00
Martin Kojtal a847ab3708
Merge pull request #13985 from 0xc0170/cmake-fix-13983
CMake: fix memory map generation
2020-12-03 09:00:46 +00:00
Martin Kojtal 4e7c7eca7e CMake ARM: move map to unify with Gcc Arm 2020-12-01 19:04:32 +00:00
Hugues Kamba 0c41cca92a CMake: Add Cypress in the list of supported targets 2020-12-01 15:17:41 +00:00
Hugues Kamba 19abde6f6a CMake: Add Maxim to the list of supported targets 2020-12-01 15:11:35 +00:00
Hugues Kamba b4bc521f13 CMake: Add support for WICED target
* Add CMakeLists.txt file
* Update the list of supported target
2020-12-01 15:05:28 +00:00
Vikas Katariya 8b70ae1d83 docs: Update to reflect Mbed CLI 2 changes
Due to the recent release of Mbed CLI 2, the command line options
have been renamed to ensure good usability and harmonize with the old
tools.

These are the following changes done:
* Minimum Cmake - 3.19.0 is required
* Minimum Mbed-tools - 4.0.0 is required
* mbed-tools cmd `init` to `new`
* mbed-tools cmd `build` to `compile`
* Removed whitespaces
2020-12-01 14:57:24 +00:00
Martin Kojtal f97c7bd957 CMake: GCC ARM linker script fix
Fixes https://github.com/ARMmbed/mbed-os/issues/13983
Move linker script to the function mbed_set_mbed_target_linker_script.

I also moved memmap as it is needed for an app. The location might not be the best fit,
we will address this in separate pull request.
2020-11-30 11:21:53 +00:00
Hugues Kamba be84b8cb0f CMake: Add Freescale in the list of supported targets 2020-11-26 16:14:06 +00:00
Hugues Kamba def23e18e0 Add ARM FM in the list of supported targets 2020-11-26 11:31:20 +00:00
Martin Kojtal 214291b6be
Merge pull request #13930 from LDong-Arm/arm_compiler_macros
CMake: pass macros to ARM toolchain linker
2020-11-24 14:11:48 +00:00
Martin Kojtal 50262876c6
Merge pull request #13928 from hugueskamba/hk_cmake_clean_arm_toolchain_support
Clean remnant of experiment with ARM toolchain
2020-11-24 14:11:26 +00:00
Martin Kojtal a1fc9cdad5
Merge pull request #13915 from 0xc0170/cmake-stm32
CMake: add all TARGET_STM targets
2020-11-24 14:09:28 +00:00
Lingkai Dong 80a0a5b440 CMake: make linker option generator function toolchain-agnostic 2020-11-19 15:23:23 +00:00
Hugues Kamba 62be4efb6c CMake: Clean remnant of experiment with ARM toolchain
The removed code was testing that compiler flags could be added
to the assembler using generator expression. It was not to be
committed.
2020-11-19 12:50:27 +00:00
Martin Kojtal 46673daabf CMake: update readme - all STM32 targets supported 2020-11-18 12:16:36 +00:00
Martin Kojtal fad7f344e7
Merge pull request #13870 from rajkan01/feature-cmake-review-comment
CMake: Address review comment from PR#13566
2020-11-18 09:42:09 +00:00
Martin Kojtal 66c05ddbf8
Merge pull request #13887 from hugueskamba/hk_cmake_update_build_instructions
CMake: Specify mbedtools in the build instructions
2020-11-12 13:50:46 +00:00
Rajkumar Kanagaraj 991b02ca7e CMake: Replace mbed_set_language_standard with target_compile_features and remove MBED_TARGET_LABELS variable resetting 2020-11-12 11:27:10 +00:00
Hugues Kamba a70edcda0a CMake: Fix error that prevented re-build
Promote MBED_TOOLCHAIN_FILE_USED to cache variable so
its previous state can be recalled when re-building. This
is because CMAKE_TOOLCHAIN_FILE is also a cache variable and its
value is set on first run when it has not been set.
2020-11-10 19:54:47 +00:00
Hugues Kamba 97c7a38bec CMake: Specify mbedtools in the build instructions
mbedtools provides a more user friendly UX for
building application.
2020-11-10 18:54:30 +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
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
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
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
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
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 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
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 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
Hugues Kamba cac1b25465 CMake: Move modules under tools subdirectory 2020-11-06 17:25:21 +00:00