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
pull/14803/head
Jaeden Amero 2021-07-06 13:21:32 +01:00
parent c3f3ed7661
commit ef07746443
1 changed files with 1 additions and 1 deletions

View File

@ -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()