CMake: Update readme about new MBED_TEST_LINK_LIBRARIES command line argument

pull/14247/head
Rajkumar Kanagaraj 2021-02-11 11:28:51 -08:00
parent b1c4c446d2
commit c93901a804
1 changed files with 12 additions and 2 deletions

View File

@ -87,14 +87,24 @@ $ mbedtools configure -t <TOOLCHAIN> -m <MBED_TARGET>
```
* Copy `.mbedbuild/` into the test suite directory.
* Set your current directory to the test suite directory
* 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.
For example:
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.
* Run the following command to build the test binary with the full profile
```
touch mbed-os.lib && mkdir cmake_build && cd cmake_build && cmake .. -G Ninja && cmake --build .
mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -DMBED_TEST_LINK_LIBRARIES=mbed-os && cmake --build .
```
* Run the following command to build the test binary with the baremetal profile
```
touch mbed-os.lib && mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -DMBED_BAREMETAL_GREENTEA_TEST=ON && cmake --build .
mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -DMBED_TEST_LINK_LIBRARIES=mbed-baremetal && cmake --build .
```
* Run the following command to build the test binary with the full profile and XYZ library
```
mkdir cmake_build && cd cmake_build && cmake .. -G Ninja -D"MBED_TEST_LINK_LIBRARIES=mbed-os XYZ" && cmake --build .
```
Notes: