-
Notifications
You must be signed in to change notification settings - Fork 3k
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
CMake: Add initial support #13566
CMake: Add initial support #13566
Conversation
@hugueskamba, thank you for your changes. |
I'll fix travis (I'll create PRs to all supported examples, they should be aligned). I'll reference all PRs (I'll need to fix some travis settings there and rebase all). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff and really glad to seeing this coming to master! I'd like to see more context in the documentation as detailed below - basically the background/why we're doing this and what's the plan.
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>
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.
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.
…me depth and format as old mbed-CLI
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.
…put 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.
Compile defintions are always included. However, functions that set compile options are only called if a third party toolchain file is not used
Check if the selected application profile is supported by the selected Mbed Target
73a9c03
to
073ae1d
Compare
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 5 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Addition of CMake modules and input source files to configure the project and generate the scripts needed by the build systems (tested with Unix Makefiles and Ninja) to build Mbed OS as a library. Mbed OS is built as collection of all libraries supported by a given target.
There are two main targets:
mbed-os
andmbed-baremetal
. The rest of the components in the Mbed OS repository are targets prefixed withmbed-
, for examplembed-ble
andmbed-netsockets
.Even though this is still under development. This PR was raised as the current state does not affect builds of the OS with the traditional tools (Mbed CLI, Online compiler, Mbed Studio).
For current state of development, supported targets, supported toolchains, known issues, and build steps, see "Documentations" section below.
Impact of changes
Adding/removing source files or subdirectories requires adding or updating CMake input source files as all source files are listed in them.
Migration actions required
Documentation
https://github.com/ARMmbed/mbed-os/blob/feature-cmake/tools/cmake/README.md
Pull request type
Test results
Reviewers