Skip to content

Commit c93901a

Browse files
committed
CMake: Update readme about new MBED_TEST_LINK_LIBRARIES command line argument
1 parent b1c4c44 commit c93901a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tools/cmake/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,24 @@ $ mbedtools configure -t <TOOLCHAIN> -m <MBED_TARGET>
8787
```
8888
* Copy `.mbedbuild/` into the test suite directory.
8989
* Set your current directory to the test suite directory
90+
91+
* Cmake `MBED_TEST_LINK_LIBRARIES` command-line argument config must be passed either `mbed-os` or `mbed-baremetal` when you are building a greentea test. In addition to that, you must pass any extra library along if that library source is not maintained as part of mbed os source tree.
92+
93+
For example:
94+
kvstore greentea test is dependent on `mbed-storage` and `mbed-storage-filesystemstore` library however you don't need to pass it via `MBED_TEST_LINK_LIBRARIES` as it is already target linked in greentea test CMakeLists.txt, at the same time some libraries and test cases are private to the application and if you want to use it with kvstore test then pass it with `MBED_TEST_LINK_LIBRARIES` command-line argument.
95+
9096
* Run the following command to build the test binary with the full profile
9197
9298
```
93-
touch mbed-os.lib && mkdir cmake_build && cd cmake_build && cmake .. -G Ninja && cmake --build .
99+
mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -DMBED_TEST_LINK_LIBRARIES=mbed-os && cmake --build .
94100
```
95101
* Run the following command to build the test binary with the baremetal profile
96102
```
97-
touch mbed-os.lib && mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -DMBED_BAREMETAL_GREENTEA_TEST=ON && cmake --build .
103+
mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -DMBED_TEST_LINK_LIBRARIES=mbed-baremetal && cmake --build .
104+
```
105+
* Run the following command to build the test binary with the full profile and XYZ library
106+
```
107+
mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -D"MBED_TEST_LINK_LIBRARIES=mbed-os XYZ" && cmake --build .
98108
```
99109
100110
Notes:

0 commit comments

Comments
 (0)