mbed-os/cmake
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
..
cores CMake cores: fix flag mpcu for asm 2020-11-06 17:25:20 +00:00
profiles CMake: Set language std per target using properties 2020-11-06 17:25:19 +00:00
toolchains CMake: Fix GCC_ARM pre-linking stage (#13575) 2020-11-06 17:25:20 +00:00
README.md CMake: Add information about the current state of support (#13551) 2020-11-06 17:25:20 +00:00
core.cmake CMake: Add CMake scripts 2020-11-06 17:25:14 +00:00
profile.cmake CMake: Profile comments update 2020-11-06 17:25:18 +00:00
toolchain.cmake CMake: use response files 2020-11-06 17:25:20 +00:00
util.cmake CMake: mbed_add_cmake_directory_if_labels checks presence of CMakeLists.txt before adding subdirectory 2020-11-06 17:25:20 +00:00

README.md

CMake for Mbed OS

Until further notice, CMake for Mbed OS is still in development.

Application profile selection (bare metal or full), printf library selection (minimal-printf or std), C library selection (small or std) and other features that require altering compiler/linker command line options are not yet supported. The full profile with the standard printf and C library are selected by default.

Supported targets

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

These targets should work:

  • K64F
  • DISCO_L475VG_IOT01A
  • NRF52840_DK
  • WIO_3G
  • K66F

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.18.2
  • mbed-tools >=3.2.0

From the application root or wherever mbed-os.lib is found:

  1. Run the following command to create the Mbed OS configuration CMake module:

    mbedtools configure -m <mbed-target> -t <toolchain>
    
  2. Run the following command to create a build directory, generate the project configuration and build the project using Ninja:

    mkdir build && cd build && cmake .. -GNinja && cmake --build .
    

The default build type is Develop. Use CMAKE_BUILD_TYPE to select Develop, Release or Debug as follows:

cmake .. -GNinja -DCMAKE_BUILD_TYPE=<supported-build-type> && cmake --build .