Skip to content

Commit d2fc596

Browse files
committed
CMake: greentea: Set variables usually defined by external apps
We rely on external applications to set MBED_CONFIG_PATH and include app.cmake. Mbed OS can't build for a target without those parameters set. When building greentea tests there is no external application. So, we define the appropriate settings in our root CMakeLists.txt for greentea tests.
1 parent a0c853d commit d2fc596

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
88
option(BUILD_TESTING "Run unit tests only." OFF)
99
option(BUILD_GREENTEA_TESTS "Build greentea tests only." OFF)
1010

11+
if(BUILD_GREENTEA_TESTS)
12+
# Usually we rely on the application to set MBED_CONFIG_PATH and include
13+
# app.cmake. They are both required if we're building an application to run
14+
# on an mbed-target.
15+
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "")
16+
# TODO: Remove when https://github.com/ARMmbed/mbed-os/issues/14518 is fixed
17+
include(${CMAKE_CURRENT_LIST_DIR}/tools/cmake/app.cmake)
18+
endif()
19+
1120
if(${CMAKE_CROSSCOMPILING})
1221
include(${MBED_CONFIG_PATH}/mbed_config.cmake)
1322
include(mbed_set_linker_script)

0 commit comments

Comments
 (0)