Skip to content

Commit 6309f9b

Browse files
Cmake: Add MBED_TEST_MODE macro
Fixes #14494 MBED_TEST_MODE was used in CLI1 to prevent multiple applications from being built. Add the macro to provide backward compatibility. CLI1 Reference: https://os.mbed.com/docs/mbed-os/v6.9/debug-test/greentea-for-testing-applications.html
1 parent 38796d0 commit 6309f9b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ target_compile_definitions(mbed-core
7272
${MBED_CONFIG_DEFINITIONS}
7373
)
7474

75+
# Add MBED_TEST_MODE for backward compatibility with Greentea testing in CLI1
76+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
77+
target_compile_definitions(${PROJECT_NAME}
78+
PUBLIC
79+
MBED_TEST_MODE
80+
)
81+
endif()
82+
7583
# We need to generate a "response file" to pass to the C preprocessor when we preprocess the linker
7684
# script, because of path length limitations on Windows. We set the response file and bind the path
7785
# to a global property here. The MBED_TARGET being built queries this global property when it sets

0 commit comments

Comments
 (0)