From ef077464432f1408329781c22389febfcb6f435c Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Tue, 6 Jul 2021 13:21:32 +0100 Subject: [PATCH] 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 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fa4c9906c..3b96df785c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,7 @@ if(${CMAKE_CROSSCOMPILING}) # Add MBED_TEST_MODE for backward compatibility with Greentea tests written for use with Mbed CLI 1 if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) target_compile_definitions(${PROJECT_NAME} - PUBLIC + INTERFACE MBED_TEST_MODE ) endif()