Skip to content

Commit fed2848

Browse files
committed
cmake: Set MBED_TEST_MODE privately
Set MBED_TEST_MODE as PRIVATE. We don't need MBED_TEST_MODE set for applications, only tests built with the "mbed-os" project. This also helps avoid the following error when building an application, given that applications currently are built as part of the "mbed-os" project, due to limitations with Mbed OS's toolchain support (see #14518 for more information on toolchain support). CMake Error at mbed-os/CMakeLists.txt:96 (target_compile_definitions): target_compile_definitions may only set INTERFACE properties on INTERFACE targets
1 parent 6a6bbe0 commit fed2848

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ if(${CMAKE_CROSSCOMPILING})
9494
# Add MBED_TEST_MODE for backward compatibility with Greentea tests written for use with Mbed CLI 1
9595
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
9696
target_compile_definitions(${PROJECT_NAME}
97-
PUBLIC
97+
PRIVATE
9898
MBED_TEST_MODE
9999
)
100100
endif()

0 commit comments

Comments
 (0)