Skip to content

Commit 46b7ca0

Browse files
0xc0170hugueskamba
authored andcommitted
CMake: Add information about the current state of support (#13551)
1 parent afddca4 commit 46b7ca0

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

cmake/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## CMake for Mbed OS
2+
3+
Until further notice, CMake for Mbed OS is still in development.
4+
5+
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.
6+
The full profile with the standard printf and C library are selected by default.
7+
8+
### Supported targets
9+
10+
Only a limited set of targets is supported at the moment.
11+
12+
These targets should work:
13+
- K64F
14+
- DISCO_L475VG_IOT01A
15+
- NRF52840_DK
16+
- WIO_3G
17+
- K66F
18+
19+
### Supported toolchains
20+
21+
Arm Compiler 6 and GNU Arm Embedded toolchains are supported.
22+
23+
### Examples
24+
25+
Supported examples can be identified by the presence of a top level `CMakelists.txt` input source file.
26+
27+
### Known issues
28+
29+
- ARMClang6: the assembler does not include definitions. It will be fixed in the upcoming release (>3.18.2). Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/21148#note_823305
30+
- Ninja: ARMClang6 response files require unix paths on Windows. Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/21093
31+
32+
## How to build an application
33+
34+
Prerequisities:
35+
- CMake >=3.18.2
36+
- mbed-tools >=3.2.0
37+
38+
From the application root or wherever `mbed-os.lib` is found:
39+
1. Run the following command to create the Mbed OS configuration CMake module:
40+
41+
```
42+
mbedtools configure -m <mbed-target> -t <toolchain>
43+
```
44+
45+
1. Run the following command to create a build directory, generate the project configuration and build the project using `Ninja`:
46+
47+
```
48+
mkdir build && cd build && cmake .. -GNinja && cmake --build .
49+
```
50+
51+
The default build type is `Develop`. Use `CMAKE_BUILD_TYPE` to select `Develop`, `Release` or `Debug` as follows:
52+
53+
```
54+
cmake .. -GNinja -DCMAKE_BUILD_TYPE=<supported-build-type> && cmake --build .
55+
```

0 commit comments

Comments
 (0)