mbed-os/tools/cmake
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
..
cores CMake: Create separate function to set MCU core compile defintions 2020-11-06 17:25:23 +00:00
profiles CMake: add mbed-os and mbed-baremetal targets 2020-11-06 17:25:22 +00:00
toolchains CMake: GCC ARM linker script fix 2020-11-30 11:21:53 +00:00
README.md Add ARM FM in the list of supported targets 2020-11-26 11:31:20 +00:00
app.cmake CMake: Fix error that prevented re-build 2020-11-10 19:54:47 +00:00
core.cmake CMake: Rename Mbed OS path variable for consistency 2020-11-06 17:25:23 +00:00
profile.cmake CMake: Rename Mbed OS path variable for consistency 2020-11-06 17:25:23 +00:00
toolchain.cmake CMake: make linker option generator function toolchain-agnostic 2020-11-19 15:23:23 +00:00

README.md

CMake for Mbed OS

In order to replace the traditional Mbed tools, we are adding CMake support to allow the generation of build systems instructions to build Mbed OS as a library.

This is still at the experimental stage and still in development. It does not yet completely replace our current build tools. If you find a bug, please report it or raise a pull request as contributions are welcome!

Mbed OS is built as collection of all core libraries. Application project executables can be linked with the mbed-os library (which includes the core libraries of Mbed OS) and optional mbed-os- prefixed libraries depending on the additional features required by the projects and supported by the Mbed target.

The list of optional libraries for each component can be seen in the CMake input source file at the root of each component directory.

The following features are not yet supported and will be progressively added:

  • Application profile selection (bare metal)
  • Features that require altering compiler/linker command line options (except for printf library and C selections)

The full profile with the selected printf and C libraries.

Supported targets

Only a limited set of targets is supported at the moment.

The following targets are supported:

  • all STM32 targets
  • K64F
  • K66F
  • NRF52840_DK
  • WIO_3G
  • ARM FM targets

Supported toolchains

Arm Compiler 6 and GNU Arm Embedded toolchains are supported.

Examples

Supported examples can be identified by the presence of a top level CMakelists.txt input source file.

Known issues

How to build an application

Prerequisities:

  • CMake >=3.19.0
  • mbed-tools >=3.5.0

From the application root or wherever mbed-os.lib is found, run the following command to:

  • create the Mbed OS configuration CMake module

  • create a build directory

  • generate the project configuration

  • build the project using the Ninja build system

    mbedtools build -m <mbed-target> -t <toolchain>
    

CMAKE_BUILD_TYPE can overridden with Mbed specific values: Develop (default value), Release and Debug.

mbed-tools will pass -DCMAKE_BUILD_TYPE=<supported-build-type> for you when using the --build-type optional argument of the build subcommand as follows:

mbedtools build -m <mbed-target> -t <toolchain> -b <supported-build-type>

If you're running CMake directly, you may need to pass it in yourself as follows:

cmake -S <source-dir> -B <build-dir> -DCMAKE_BUILD_TYPE=debug