cmake: fix present inclusion

We use only _PRESENT macros for components if they are enabled. Use the same in
the mbed.h file or anywhere else.
pull/13566/head
Martin Kojtal 2020-10-14 06:31:34 +01:00 committed by Hugues Kamba
parent 8016a53400
commit 8529e88e61
5 changed files with 4 additions and 10 deletions

View File

@ -43,7 +43,6 @@ target_sources(mbed-os-netsocket
target_compile_definitions(mbed-os-netsocket
INTERFACE
MBED_CONF_NETSOCKET_PRESENT=1
MBED_CONF_CMAKE_NETSOCKET_ENABLED=1
)
target_link_libraries(mbed-os-netsocket

View File

@ -23,5 +23,4 @@ target_sources(mbed-os-events
target_compile_definitions(mbed-os-events
INTERFACE
MBED_CONF_EVENTS_PRESENT=1
MBED_CONF_CMAKE_EVENTS_ENABLED
)

10
mbed.h
View File

@ -19,22 +19,20 @@
#include "platform/mbed_version.h"
// MBED_CONF_CMAKE is temporary until tools do not set _PRESENT macros
#if defined(MBED_CONF_RTOS_PRESENT) && defined(MBED_CONF_CMAKE_RTOS_ENABLED)
#if defined(MBED_CONF_RTOS_PRESENT)
#include "rtos/rtos.h"
#endif
#if defined(MBED_CONF_NETSOCKET_PRESENT) && defined(MBED_CONF_CMAKE_NETSOCKET_ENABLED)
#if defined(MBED_CONF_NETSOCKET_PRESENT)
#include "netsocket/nsapi.h"
#include "netsocket/nsapi_ppp.h"
#endif
#if defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_CMAKE_EVENTS_ENABLED)
#if defined(MBED_CONF_EVENTS_PRESENT)
#include "events/mbed_events.h"
#endif
#if defined(MBED_CONF_FILESYSTEM_PRESENT) && defined(MBED_CONF_CMAKE_FILESYSTEM_ENABLED)
#if defined(MBED_CONF_FILESYSTEM_PRESENT)
#include "filesystem/mbed_filesystem.h"
#endif

View File

@ -24,5 +24,4 @@ target_sources(mbed-os
target_compile_definitions(mbed-os
PUBLIC
MBED_CONF_RTOS_PRESENT=1
MBED_CONF_CMAKE_RTOS_ENABLED=1
)

View File

@ -33,5 +33,4 @@ target_include_directories(mbed-os-storage
target_compile_definitions(mbed-os-storage
INTERFACE
MBED_CONF_FILESYSTEM_PRESENT=1
MBED_CONF_CMAKE_FILESYSTEM_ENABLED=1
)