diff --git a/connectivity/FEATURE_BLE/source/cordio/TESTS/cordio_hci/driver/CMakeLists.txt b/connectivity/FEATURE_BLE/source/cordio/TESTS/cordio_hci/driver/CMakeLists.txt index 6c082a0..ddcac06 100644 --- a/connectivity/FEATURE_BLE/source/cordio/TESTS/cordio_hci/driver/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/source/cordio/TESTS/cordio_hci/driver/CMakeLists.txt @@ -8,5 +8,4 @@ main.cpp TEST_REQUIRED_LIBS mbed-ble - mbed-events ) diff --git a/connectivity/libraries/ppp/CMakeLists.txt b/connectivity/libraries/ppp/CMakeLists.txt index d2a2b75..433751d 100644 --- a/connectivity/libraries/ppp/CMakeLists.txt +++ b/connectivity/libraries/ppp/CMakeLists.txt @@ -55,7 +55,6 @@ target_link_libraries(mbed-ppp PUBLIC - mbed-events mbed-netsocket-api PRIVATE mbed-rtos-flags diff --git a/connectivity/lorawan/CMakeLists.txt b/connectivity/lorawan/CMakeLists.txt index b463316..a17e9b5 100644 --- a/connectivity/lorawan/CMakeLists.txt +++ b/connectivity/lorawan/CMakeLists.txt @@ -35,6 +35,5 @@ target_link_libraries(mbed-lorawan PUBLIC - mbed-events mbed-mbedtls ) diff --git a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt index e435cc4..f10d0e0 100644 --- a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt +++ b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt @@ -27,7 +27,6 @@ mbed-core-flags mbed-randlib mbed-nanostack-sal_stack-event_loop - mbed-events mbed-nanostack-libservice mbed-nanostack-sal_stack PRIVATE diff --git a/connectivity/netsocket/CMakeLists.txt b/connectivity/netsocket/CMakeLists.txt index 025da92..9e810ca 100644 --- a/connectivity/netsocket/CMakeLists.txt +++ b/connectivity/netsocket/CMakeLists.txt @@ -53,7 +53,6 @@ PUBLIC mbed-core-flags mbed-mbedtls - mbed-events ) add_library(mbed-netsocket INTERFACE) diff --git a/connectivity/nfc/CMakeLists.txt b/connectivity/nfc/CMakeLists.txt index a404051..7dd62f5 100644 --- a/connectivity/nfc/CMakeLists.txt +++ b/connectivity/nfc/CMakeLists.txt @@ -46,9 +46,4 @@ target_compile_definitions(mbed-nfc PUBLIC MBED_CONF_NFC_PRESENT=1 -) - -target_link_libraries(mbed-nfc - PUBLIC - mbed-events -) +) \ No newline at end of file diff --git a/events/CMakeLists.txt b/events/CMakeLists.txt index 4b81019..9960a3b 100644 --- a/events/CMakeLists.txt +++ b/events/CMakeLists.txt @@ -9,31 +9,26 @@ endif() endif() -add_library(mbed-events STATIC EXCLUDE_FROM_ALL) - -target_include_directories(mbed-events - PUBLIC +# Note: The event queue library gets a different implementation when the RTOS is or is not included. +# So, we add it to the core Mbed lib so that it will be built once for each Mbed version. +target_include_directories(mbed-core-flags + INTERFACE . ./include ./include/events ./include/events/internal ) -target_sources(mbed-events - PRIVATE +target_compile_definitions(mbed-core-flags + INTERFACE + MBED_CONF_EVENTS_PRESENT=1 +) + +target_sources(mbed-core-sources + INTERFACE source/EventQueue.cpp source/equeue.c source/equeue_mbed.cpp source/equeue_posix.c source/mbed_shared_queues.cpp -) - -target_compile_definitions(mbed-events - PUBLIC - MBED_CONF_EVENTS_PRESENT=1 -) - -target_link_libraries(mbed-events - PUBLIC - mbed-core-flags ) \ No newline at end of file diff --git a/events/tests/TESTS/events/equeue/CMakeLists.txt b/events/tests/TESTS/events/equeue/CMakeLists.txt index f49813e..19a6870 100644 --- a/events/tests/TESTS/events/equeue/CMakeLists.txt +++ b/events/tests/TESTS/events/equeue/CMakeLists.txt @@ -15,6 +15,4 @@ ${TEST_TARGET} TEST_SOURCES main.cpp - TEST_REQUIRED_LIBS - mbed-events ) diff --git a/events/tests/TESTS/events/queue/CMakeLists.txt b/events/tests/TESTS/events/queue/CMakeLists.txt index 06183db..56d667d 100644 --- a/events/tests/TESTS/events/queue/CMakeLists.txt +++ b/events/tests/TESTS/events/queue/CMakeLists.txt @@ -15,6 +15,4 @@ ${TEST_TARGET} TEST_SOURCES main.cpp - TEST_REQUIRED_LIBS - mbed-events ) diff --git a/events/tests/TESTS/events/timing/CMakeLists.txt b/events/tests/TESTS/events/timing/CMakeLists.txt index f979ea3..a81af60 100644 --- a/events/tests/TESTS/events/timing/CMakeLists.txt +++ b/events/tests/TESTS/events/timing/CMakeLists.txt @@ -15,6 +15,4 @@ ${TEST_TARGET} TEST_SOURCES main.cpp - TEST_REQUIRED_LIBS - mbed-events )