Skip to content

Commit ef07746

Browse files
committed
cmake: Set MBED_TEST_MODE with INTERFACE
Set MBED_TEST_MODE with INTERFACE. Use INTERFACE because mbed-os is an interface target, and we can only set INTERFACE properties on interface targets. This helps avoid the following error when building an application. CMake Error at mbed-os/CMakeLists.txt:96 (target_compile_definitions): target_compile_definitions may only set INTERFACE properties on INTERFACE targets
1 parent c3f3ed7 commit ef07746

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+
INTERFACE
9898
MBED_TEST_MODE
9999
)
100100
endif()

0 commit comments

Comments
 (0)