From c93901a804f4596287b68d45b4ff2bb7ab50b23e Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj Date: Thu, 11 Feb 2021 11:28:51 -0800 Subject: [PATCH] CMake: Update readme about new MBED_TEST_LINK_LIBRARIES command line argument --- tools/cmake/README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/cmake/README.md b/tools/cmake/README.md index 2e80761759..cb653340c8 100644 --- a/tools/cmake/README.md +++ b/tools/cmake/README.md @@ -87,14 +87,24 @@ $ mbedtools configure -t -m ``` * 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: