diff --git a/connectivity/FEATURE_BLE/CMakeLists.txt b/connectivity/FEATURE_BLE/CMakeLists.txt index 1e9da9185a..fbd35db9af 100644 --- a/connectivity/FEATURE_BLE/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/CMakeLists.txt @@ -2,7 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) - add_subdirectory(tests/UNITTESTS) + if(NOT BUILD_GREENTEA_TESTS) + add_subdirectory(tests/UNITTESTS) + endif() endif() add_subdirectory(libraries) diff --git a/connectivity/libraries/CMakeLists.txt b/connectivity/libraries/CMakeLists.txt index 7d856fa25c..21af84b317 100644 --- a/connectivity/libraries/CMakeLists.txt +++ b/connectivity/libraries/CMakeLists.txt @@ -2,7 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) - add_subdirectory(tests/UNITTESTS) + if(NOT BUILD_GREENTEA_TESTS) + add_subdirectory(tests/UNITTESTS) + endif() endif() add_subdirectory(mbed-coap) diff --git a/connectivity/mbedtls/CMakeLists.txt b/connectivity/mbedtls/CMakeLists.txt index f000967e33..7bacaa6d97 100644 --- a/connectivity/mbedtls/CMakeLists.txt +++ b/connectivity/mbedtls/CMakeLists.txt @@ -2,7 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) - add_subdirectory(tests/UNITTESTS) + if(NOT BUILD_GREENTEA_TESTS) + add_subdirectory(tests/UNITTESTS) + endif() endif() target_include_directories(mbed-mbedtls