CMake: core should expose also compile defs from target

pull/14427/head
Martin Kojtal 2021-03-01 17:12:36 +00:00
parent 79fac4f62e
commit 86f1ad74cc
1 changed files with 1 additions and 0 deletions

View File

@ -155,6 +155,7 @@ add_subdirectory(cmsis/device/rtos EXCLUDE_FROM_ALL)
target_link_options(mbed-core INTERFACE $<TARGET_PROPERTY:${MBED_TARGET_CONVERTED},INTERFACE_LINK_OPTIONS>)
# Expose include directories. cmsis.h/device.h and other headers are required by libraries or applications
target_include_directories(mbed-core INTERFACE $<TARGET_PROPERTY:${MBED_TARGET_CONVERTED},INTERFACE_INCLUDE_DIRECTORIES>)
target_compile_definitions(mbed-core INTERFACE $<TARGET_PROPERTY:${MBED_TARGET_CONVERTED},COMPILE_DEFINITIONS>)
# Some of core files require MBED_CONF_RTOS_PRESENT symbol. For baremetal, it's sufficient to link with mbed-core (symbol undefined = RTOS not present). For Mbed OS, this symbol must be defined and set, therefore we copy sources and build them together with this flag
get_property(MBED_CORE_SOURCES TARGET mbed-core-obj PROPERTY SOURCES)