diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bd9eae..afe5226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ include(${MBED_ROOT}/tools/cmake/util.cmake) include(${MBED_ROOT}/tools/cmake/profile.cmake) -# Create Mbed OS library add_library(mbed-os OBJECT) # Validate selected C library type @@ -80,19 +79,26 @@ ${CMAKE_CURRENT_SOURCE_DIR} ) -# Default build +# TODO CMake: This component is made visible here so its source files in +# drivers/ can be added and it can be linked against by libraries in storage/. +# Should the source files be moved from drivers/ to storage/ ? +add_library(mbed-os-device_key INTERFACE) + add_subdirectory(cmsis) -add_subdirectory(components) -add_subdirectory(connectivity) add_subdirectory(drivers) -add_subdirectory(events) -add_subdirectory(features) add_subdirectory(hal) add_subdirectory(platform) add_subdirectory(rtos) -add_subdirectory(storage) add_subdirectory(targets) +# The directories below contain optional target libraries +add_subdirectory(events EXCLUDE_FROM_ALL) +add_subdirectory(connectivity EXCLUDE_FROM_ALL) +add_subdirectory(storage EXCLUDE_FROM_ALL) +add_subdirectory(drivers/device_key EXCLUDE_FROM_ALL) +add_subdirectory(drivers/source/usb EXCLUDE_FROM_ALL) +add_subdirectory(features EXCLUDE_FROM_ALL) +add_subdirectory(platform/FEATURE_EXPERIMENTAL_API EXCLUDE_FROM_ALL) # # Configures the application @@ -134,7 +140,6 @@ ) endfunction() - # # Converts output file of `target` to binary file and to Intel HEX file. # diff --git a/cmsis/CMakeLists.txt b/cmsis/CMakeLists.txt index 026ae16..b2442a6 100644 --- a/cmsis/CMakeLists.txt +++ b/cmsis/CMakeLists.txt @@ -3,3 +3,4 @@ add_subdirectory(CMSIS_5) add_subdirectory(device) + diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt deleted file mode 100644 index a425e5d..0000000 --- a/components/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -add_subdirectory(testing) diff --git a/components/testing/CMakeLists.txt b/components/testing/CMakeLists.txt deleted file mode 100644 index c692f36..0000000 --- a/components/testing/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -mbed_add_cmake_directory_if_labels("COMPONENT") diff --git a/components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt b/components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt deleted file mode 100644 index 8aef22c..0000000 --- a/components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -target_sources(mbed-os - PRIVATE - DynamicPinList.cpp - I2CTester.cpp - MbedTester.cpp - SPIMasterTester.cpp - SPISlaveTester.cpp - SPITester.cpp - UARTTester.cpp -) - -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index a4d2bdf..bd9a6da 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -1,8 +1,33 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("FEATURE") +# List of all connectivity libraries available. +add_library(mbed-os-802.15.4-rf INTERFACE) +add_library(mbed-os-ble INTERFACE) +add_library(mbed-os-ble-blue_nrg INTERFACE) +add_library(mbed-os-ble-cordio INTERFACE) +add_library(mbed-os-ble-cordio_ll INTERFACE) +add_library(mbed-os-cellular INTERFACE) +add_library(mbed-os-coap INTERFACE) +add_library(mbed-os-emac INTERFACE) +add_library(mbed-os-lorawan INTERFACE) +add_library(mbed-os-lwipstack INTERFACE) +add_library(mbed-os-mbedtls INTERFACE) +add_library(mbed-os-mbedtls-cryptocell310 INTERFACE) +add_library(mbed-os-nanostack INTERFACE) +add_library(mbed-os-nanostack-coap_service INTERFACE) +add_library(mbed-os-nanostack-mbed_mesh_api INTERFACE) +add_library(mbed-os-nanostack-hal_mbed_cmsis_rtos INTERFACE) +add_library(mbed-os-nanostack-sal_stack INTERFACE) +add_library(mbed-os-nanostack-sal_stack-event_loop INTERFACE) +add_library(mbed-os-nanostack-libservice INTERFACE) +add_library(mbed-os-netsocket INTERFACE) +add_library(mbed-os-nfc INTERFACE) +add_library(mbed-os-ppp INTERFACE) +add_library(mbed-os-wifi INTERFACE) + +add_subdirectory(FEATURE_BLE) add_subdirectory(cellular) add_subdirectory(drivers) add_subdirectory(libraries) @@ -12,8 +37,3 @@ add_subdirectory(nanostack) add_subdirectory(netsocket) add_subdirectory(nfc) - -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) diff --git a/connectivity/FEATURE_BLE/CMakeLists.txt b/connectivity/FEATURE_BLE/CMakeLists.txt index d318516..98ce804 100644 --- a/connectivity/FEATURE_BLE/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/CMakeLists.txt @@ -4,8 +4,8 @@ add_subdirectory(libraries) add_subdirectory(source) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-ble + INTERFACE . include include/ble @@ -20,3 +20,8 @@ include/ble/services source ) + +target_compile_definitions(mbed-os-ble + INTERFACE + MBED_CONF_BLE_PRESENT=1 +) diff --git a/connectivity/FEATURE_BLE/libraries/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/CMakeLists.txt index 3f88cff..f9be18d 100644 --- a/connectivity/FEATURE_BLE/libraries/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/libraries/CMakeLists.txt @@ -1,11 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("CORDIO_LL" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CORDIO_LL) +endif() add_subdirectory(cordio_stack) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-ble-cordio + INTERFACE . ) + +target_link_libraries(mbed-os-ble-cordio + INTERFACE + mbed-os-ble +) diff --git a/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/CMakeLists.txt index 082bce8..62a88a4 100644 --- a/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/CMakeLists.txt @@ -1,29 +1,29 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/stack - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/include - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/include/ble - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/include/common - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/sources/ble/bb - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/sources/ble/include - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/sources/ble/lctr - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/sources/ble/lhci - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/sources/ble/sch - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/sources/common/bb - ${CMAKE_CURRENT_SOURCE_DIR}/stack/controller/sources/common/sch - ${CMAKE_CURRENT_SOURCE_DIR}/stack/thirdparty - ${CMAKE_CURRENT_SOURCE_DIR}/stack/thirdparty/nordic-bsp/components/boards - ${CMAKE_CURRENT_SOURCE_DIR}/stack/thirdparty/uecc - ${CMAKE_CURRENT_SOURCE_DIR}/stack_adaptation +target_include_directories(mbed-os-ble-cordio_ll + INTERFACE + . + ./stack + ./stack/controller + ./stack/controller/include + ./stack/controller/include/ble + ./stack/controller/include/common + ./stack/controller/sources/ble/bb + ./stack/controller/sources/ble/include + ./stack/controller/sources/ble/lctr + ./stack/controller/sources/ble/lhci + ./stack/controller/sources/ble/sch + ./stack/controller/sources/common/bb + ./stack/controller/sources/common/sch + ./stack/thirdparty + ./stack/thirdparty/nordic-bsp/components/boards + ./stack/thirdparty/uecc + ./stack_adaptation ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/controller/sources/ble/bb/bb_ble_adv_master.c stack/controller/sources/ble/bb/bb_ble_adv_master_ae.c stack/controller/sources/ble/bb/bb_ble_adv_slave.c @@ -45,14 +45,14 @@ stack/controller/sources/ble/bb/bb_ble_whitelist.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/controller/sources/ble/init/init.c stack/controller/sources/ble/init/init_ctr.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/controller/sources/ble/lctr/lctr_act_adv_master.c stack/controller/sources/ble/lctr/lctr_act_adv_master_ae.c stack/controller/sources/ble/lctr/lctr_act_adv_slave.c @@ -145,8 +145,8 @@ stack/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/controller/sources/ble/lhci/lhci_cmd.c stack/controller/sources/ble/lhci/lhci_cmd_adv_master.c stack/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c @@ -224,8 +224,8 @@ stack/controller/sources/ble/lhci/lhci_main_iso.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/controller/sources/ble/ll/ll_init.c stack/controller/sources/ble/ll/ll_init_adv_master.c stack/controller/sources/ble/ll/ll_init_adv_master_ae.c @@ -275,8 +275,8 @@ stack/controller/sources/ble/ll/ll_math.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/controller/sources/ble/lmgr/lmgr_events.c stack/controller/sources/ble/lmgr/lmgr_main.c stack/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c @@ -290,15 +290,15 @@ stack/controller/sources/ble/lmgr/lmgr_main_slave.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/controller/sources/ble/sch/sch_ble.c stack/controller/sources/ble/sch/sch_rm.c stack/controller/sources/ble/sch/sch_tm.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/controller/sources/common/bb/bb_main.c stack/controller/sources/common/chci/chci_tr.c @@ -307,8 +307,8 @@ stack/controller/sources/common/sch/sch_main.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack/thirdparty/nordic-bsp/components/boards/boards.c stack/thirdparty/uecc/asm_arm.inc @@ -316,7 +316,12 @@ stack/thirdparty/uecc/uECC_ll.c ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio_ll + INTERFACE stack_adaptation/custom_chci_tr.cpp ) + +target_link_libraries(mbed-os-ble-cordio_ll + INTERFACE + mbed-os-ble-cordio +) diff --git a/connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/CMakeLists.txt index c0f5e7f..09923be 100644 --- a/connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-ble-cordio + INTERFACE include sources/hci/dual_chip sources/sec/common @@ -14,8 +14,8 @@ sources/stack/smp ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio + INTERFACE sources/hci/common/hci_core.c sources/hci/dual_chip/hci_cmd.c diff --git a/connectivity/FEATURE_BLE/libraries/cordio_stack/platform/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/cordio_stack/platform/CMakeLists.txt index 0e955b2..9a4acaa 100644 --- a/connectivity/FEATURE_BLE/libraries/cordio_stack/platform/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/libraries/cordio_stack/platform/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-ble-cordio + INTERFACE include ) diff --git a/connectivity/FEATURE_BLE/libraries/cordio_stack/wsf/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/cordio_stack/wsf/CMakeLists.txt index 4616490..b02bb56 100644 --- a/connectivity/FEATURE_BLE/libraries/cordio_stack/wsf/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/libraries/cordio_stack/wsf/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-ble-cordio + INTERFACE include include/util ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio + INTERFACE sources/port/baremetal/wsf_assert.c sources/port/baremetal/wsf_buf.c sources/port/baremetal/wsf_bufio.c diff --git a/connectivity/FEATURE_BLE/source/CMakeLists.txt b/connectivity/FEATURE_BLE/source/CMakeLists.txt index f4ee93b..eaaa293 100644 --- a/connectivity/FEATURE_BLE/source/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/source/CMakeLists.txt @@ -7,8 +7,8 @@ add_subdirectory(generic) add_subdirectory(pal) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE BLE.cpp Gap.cpp GattClient.cpp diff --git a/connectivity/FEATURE_BLE/source/cordio/CMakeLists.txt b/connectivity/FEATURE_BLE/source/cordio/CMakeLists.txt index a91a822..3f53b04 100644 --- a/connectivity/FEATURE_BLE/source/cordio/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/source/cordio/CMakeLists.txt @@ -1,15 +1,15 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-ble-cordio + INTERFACE . source stack_adaptation ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio + INTERFACE driver/CordioHCIDriver.cpp driver/CordioHCITransportDriver.cpp driver/H4TransportDriver.cpp diff --git a/connectivity/FEATURE_BLE/source/gap/CMakeLists.txt b/connectivity/FEATURE_BLE/source/gap/CMakeLists.txt index 1f77abd..e6b3287 100644 --- a/connectivity/FEATURE_BLE/source/gap/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/source/gap/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE AdvertisingDataBuilder.cpp AdvertisingParameters.cpp ConnectionParameters.cpp diff --git a/connectivity/FEATURE_BLE/source/gatt/CMakeLists.txt b/connectivity/FEATURE_BLE/source/gatt/CMakeLists.txt index 1b00ca6..e827f47 100644 --- a/connectivity/FEATURE_BLE/source/gatt/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/source/gatt/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE DiscoveredCharacteristic.cpp ) diff --git a/connectivity/FEATURE_BLE/source/generic/CMakeLists.txt b/connectivity/FEATURE_BLE/source/generic/CMakeLists.txt index 6b77463..6dd46df 100644 --- a/connectivity/FEATURE_BLE/source/generic/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/source/generic/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-ble + INTERFACE . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE FileSecurityDb.cpp GapImpl.cpp GattClientImpl.cpp diff --git a/connectivity/FEATURE_BLE/source/pal/CMakeLists.txt b/connectivity/FEATURE_BLE/source/pal/CMakeLists.txt index 26f0ee3..fbe9d7c 100644 --- a/connectivity/FEATURE_BLE/source/pal/CMakeLists.txt +++ b/connectivity/FEATURE_BLE/source/pal/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-ble + INTERFACE . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE PalAttClientToGattClient.cpp ) diff --git a/connectivity/cellular/CMakeLists.txt b/connectivity/cellular/CMakeLists.txt index 48ec8fa..5f69f93 100644 --- a/connectivity/cellular/CMakeLists.txt +++ b/connectivity/cellular/CMakeLists.txt @@ -3,8 +3,8 @@ add_subdirectory(source/framework) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-cellular + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular @@ -14,3 +14,14 @@ ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/common ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/device ) + +target_compile_definitions(mbed-os-cellular + INTERFACE + MBED_CONF_CELLULAR_PRESENT=1 +) + +target_link_libraries(mbed-os-cellular + INTERFACE + mbed-os-netsocket + mbed-os +) diff --git a/connectivity/cellular/source/framework/AT/CMakeLists.txt b/connectivity/cellular/source/framework/AT/CMakeLists.txt index a2587cd..df159f2 100644 --- a/connectivity/cellular/source/framework/AT/CMakeLists.txt +++ b/connectivity/cellular/source/framework/AT/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE AT_CellularContext.cpp AT_CellularDevice.cpp AT_CellularInformation.cpp diff --git a/connectivity/cellular/source/framework/common/CMakeLists.txt b/connectivity/cellular/source/framework/common/CMakeLists.txt index bd1be4a..8c7ecda 100644 --- a/connectivity/cellular/source/framework/common/CMakeLists.txt +++ b/connectivity/cellular/source/framework/common/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE APN_db.cpp CellularLog.cpp CellularUtil.cpp diff --git a/connectivity/cellular/source/framework/device/CMakeLists.txt b/connectivity/cellular/source/framework/device/CMakeLists.txt index 3bdaef5..8a72e16 100644 --- a/connectivity/cellular/source/framework/device/CMakeLists.txt +++ b/connectivity/cellular/source/framework/device/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE ATHandler.cpp CellularContext.cpp CellularDevice.cpp diff --git a/connectivity/drivers/802.15.4_RF/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/CMakeLists.txt index 61b0ce7..2328437 100644 --- a/connectivity/drivers/802.15.4_RF/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/CMakeLists.txt @@ -1,8 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("Freescale" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Freescale) + add_subdirectory(mcr20a-rf-driver) +elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Silicon_Labs) +elseif("STM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(stm-s2lp-rf-driver) +endif() add_subdirectory(atmel-rf-driver) -add_subdirectory(mcr20a-rf-driver) -add_subdirectory(stm-s2lp-rf-driver) + +target_link_libraries(mbed-os-802.15.4-rf + INTERFACE + mbed-os-nanostack +) diff --git a/connectivity/drivers/802.15.4_RF/TARGET_Freescale/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/TARGET_Freescale/CMakeLists.txt index f403f3a..223293d 100644 --- a/connectivity/drivers/802.15.4_RF/TARGET_Freescale/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/TARGET_Freescale/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("KW41Z" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_KW41Z) +endif() diff --git a/connectivity/drivers/802.15.4_RF/TARGET_Freescale/TARGET_KW41Z/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/TARGET_Freescale/TARGET_KW41Z/CMakeLists.txt index c215437..8321769 100644 --- a/connectivity/drivers/802.15.4_RF/TARGET_Freescale/TARGET_KW41Z/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/TARGET_Freescale/TARGET_KW41Z/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-802.15.4-rf + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-802.15.4-rf + INTERFACE NanostackRfPhyKw41z.cpp ) diff --git a/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/CMakeLists.txt index f403f3a..2185e82 100644 --- a/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("SL_RAIL" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_SL_RAIL) +endif() diff --git a/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt index c9d8ce4..d8ae491 100644 --- a/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-802.15.4-rf + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-802.15.4-rf + INTERFACE NanostackRfPhyEfr32.cpp ) diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt index 3aea79b..c5779dc 100644 --- a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-802.15.4-rf + INTERFACE atmel-rf-driver source ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-802.15.4-rf + INTERFACE source/NanostackRfPhyAT86RF215.cpp source/NanostackRfPhyAtmel.cpp source/at24mac.cpp diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt index f898aef..642875e 100644 --- a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-802.15.4-rf + INTERFACE mcr20a-rf-driver source ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-802.15.4-rf + INTERFACE source/MCR20Drv.c source/NanostackRfPhyMcr20a.cpp ) diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt index b8035a6..baa009a 100644 --- a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-802.15.4-rf + INTERFACE stm-s2lp-rf-driver source ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-802.15.4-rf + INTERFACE source/NanostackRfPhys2lp.cpp source/at24mac_s2lp.cpp source/rf_configuration.c diff --git a/connectivity/drivers/ble/CMakeLists.txt b/connectivity/drivers/ble/CMakeLists.txt index 9384ae5..1bec37f 100644 --- a/connectivity/drivers/ble/CMakeLists.txt +++ b/connectivity/drivers/ble/CMakeLists.txt @@ -1,4 +1,4 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("FEATURE") +add_subdirectory(FEATURE_BLE) diff --git a/connectivity/drivers/ble/FEATURE_BLE/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/CMakeLists.txt index 2728226..5c87975 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/CMakeLists.txt @@ -1,5 +1,20 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("COMPONENT") -mbed_add_cmake_directory_if_labels("TARGET") +if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_BlueNRG_MS) +endif() + +if("CYW43XXX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_CYW43XXX) +endif() + +if("Ambiq_Micro" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Ambiq_Micro) +elseif("CY8C63XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CY8C63XX) +elseif("NORDIC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NORDIC) +elseif("STM32WB" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32WB) +endif() diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_MS/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_MS/CMakeLists.txt index 8b7653f..27bd442 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_MS/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_MS/CMakeLists.txt @@ -1,7 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-blue_nrg + INTERFACE BlueNrgMsHCIDriver.cpp ) + +target_link_libraries(mbed-os-ble-blue_nrg + INTERFACE + mbed-os-ble +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/CMakeLists.txt index 9d1410d..3d9d857 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/CMakeLists.txt @@ -1,16 +1,19 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("PSOC6" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_PSOC6) +endif() + add_subdirectory(firmware) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-ble + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE CyH4TransportDriver.cpp HCIDriver.cpp ) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/TARGET_PSOC6/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/TARGET_PSOC6/CMakeLists.txt index f796549..3d84bbf 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/TARGET_PSOC6/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/TARGET_PSOC6/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE cy_bt_cordio_cfg.cpp ) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/CMakeLists.txt index 2728226..38328c4 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/CMakeLists.txt @@ -1,5 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("COMPONENT") -mbed_add_cmake_directory_if_labels("TARGET") +if("43012" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_43012) +endif() + +if("43438" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_43438) +endif() + +if("4343W" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_4343W) +endif() + +if("CYW9P62S1_43012EVB_01" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CYW9P62S1_43012EVB_01) +endif() diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/CMakeLists.txt index 78cb5b3..22fa193 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE w_bt_firmware_controller.c ) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/CMakeLists.txt index 78cb5b3..22fa193 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE w_bt_firmware_controller.c ) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/CMakeLists.txt index 78cb5b3..22fa193 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE w_bt_firmware_controller.c ) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt index 78cb5b3..22fa193 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE w_bt_firmware_controller.c ) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/CMakelists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/CMakelists.txt new file mode 100644 index 0000000..a50db2c --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/CMakelists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("Apollo3" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Apollo3) +endif() + +target_include_directories(mbed-os-ble + INTERFACE + hal/apollo3 +) + +target_sources(mbed-os-ble + INTERFACE + hal/hci_drv_apollo3.c +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/TARGET_Apollo3/CMakelists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/TARGET_Apollo3/CMakelists.txt new file mode 100644 index 0000000..2ea83bc --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/TARGET_Apollo3/CMakelists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-os-ble + PUBLIC + . +) + +target_sources(mbed-os-ble + PRIVATE + AP3CordioHCIDriver.cpp + AP3CordioHCITransportDriver.cpp +) + +target_link_libraries(mbed-os-ble + mbed-os +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_CY8C63XX/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_CY8C63XX/CMakeLists.txt index fbe2685..ddd9981 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/TARGET_CY8C63XX/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_CY8C63XX/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/drivers +target_include_directories(mbed-os-ble + INTERFACE + . + drivers ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE Psoc6BLE.cpp drivers/IPCPipeTransportDriver.cpp ) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/CMakeLists.txt index f403f3a..db72f31 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("NORDIC_CORDIO" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NORDIC_CORDIO) +endif() diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/CMakeLists.txt index f403f3a..6178c32 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/CMakeLists.txt @@ -1,4 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("MCU_NRF52840" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_NRF52840) +elseif("NRF5x" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NRF5x) +endif() diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/CMakeLists.txt index f57dfb3..1f19b59 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/stack/include +target_include_directories(mbed-os-ble-cordio + INTERFACE + . + ./stack/include ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble-cordio + INTERFACE NRFCordioHCIDriver.cpp NRFCordioHCITransportDriver.cpp diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_STM32WB/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_STM32WB/CMakeLists.txt index 04c9a87..2971c86 100644 --- a/connectivity/drivers/ble/FEATURE_BLE/TARGET_STM32WB/CMakeLists.txt +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_STM32WB/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/STM32Cube_FW +target_include_directories(mbed-os-ble + INTERFACE + . + ./STM32Cube_FW ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ble + INTERFACE HCIDriver.cpp hw_ipcc.c diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt b/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt index b561a8a..f9dd4e9 100644 --- a/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE ALT1250_PPP.cpp ALT1250_PPP_CellularContext.cpp ALT1250_PPP_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/CMakeLists.txt b/connectivity/drivers/cellular/CMakeLists.txt index ff1bbeb..7dbf644 100644 --- a/connectivity/drivers/cellular/CMakeLists.txt +++ b/connectivity/drivers/cellular/CMakeLists.txt @@ -1,7 +1,9 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("COMPONENT") +if("STMOD_CELLULAR" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_STMOD_CELLULAR) +endif() add_subdirectory(Altair) add_subdirectory(GEMALTO) @@ -12,7 +14,7 @@ add_subdirectory(TELIT) add_subdirectory(UBLOX) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) diff --git a/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt b/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt index bce0e3d..b940936 100644 --- a/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt +++ b/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE STModCellular.cpp ) diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt b/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt index 994c9da..97d53bd 100644 --- a/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt +++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE GEMALTO_CINTERION.cpp GEMALTO_CINTERION_CellularContext.cpp GEMALTO_CINTERION_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt b/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt index 2ae14d6..34eda9b 100644 --- a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE GENERIC_AT3GPP.cpp ) diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt b/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt index cc8833e..60a9b8b 100644 --- a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-cellular + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE SARA4_PPP.cpp SARA4_PPP_CellularNetwork.cpp ) diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt index 44e2f4e..ac06a31 100644 --- a/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE QUECTEL_BC95.cpp QUECTEL_BC95_CellularContext.cpp QUECTEL_BC95_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt index b080907..d100846 100644 --- a/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE QUECTEL_BG96.cpp QUECTEL_BG96_CellularContext.cpp QUECTEL_BG96_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt index 321cc3f..3073b3a 100644 --- a/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-cellular + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE QUECTEL_EC2X.cpp ) diff --git a/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt index 9e10280..1e5e1be 100644 --- a/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE QUECTEL_M26.cpp QUECTEL_M26_CellularContext.cpp QUECTEL_M26_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt index cd555bd..1ac4aee 100644 --- a/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE - QUECTEL_UG96.cpp - QUECTEL_UG96_CellularContext.cpp +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_sources(mbed-os-cellular + INTERFACE + QUECTEL_UG96.cpp + QUECTEL_UG96_CellularContext.cpp ) diff --git a/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt b/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt index 4c21e6d..946338f 100644 --- a/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt +++ b/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE RM1000_AT.cpp RM1000_AT_CellularContext.cpp RM1000_AT_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt index c0d5017..7a45e59 100644 --- a/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE TELIT_HE910.cpp ) diff --git a/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt index 220bbb2..b4e3671 100644 --- a/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE TELIT_ME310.cpp TELIT_ME310_CellularContext.cpp TELIT_ME310_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt index 94dd2a7..9734257 100644 --- a/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-cellular + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE TELIT_ME910.cpp TELIT_ME910_CellularContext.cpp TELIT_ME910_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt index 574c2d3..1fca50d 100644 --- a/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt +++ b/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE UBLOX_AT.cpp UBLOX_AT_CellularContext.cpp UBLOX_AT_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt index ce0c657..a015f8c 100644 --- a/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt +++ b/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE UBLOX_N2XX.cpp UBLOX_N2XX_CellularContext.cpp UBLOX_N2XX_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt index 73af6cf..6f82f80 100644 --- a/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-cellular + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-cellular + INTERFACE UBLOX_PPP.cpp ) diff --git a/connectivity/drivers/emac/CMakeLists.txt b/connectivity/drivers/emac/CMakeLists.txt index f403f3a..4ea7dfe 100644 --- a/connectivity/drivers/emac/CMakeLists.txt +++ b/connectivity/drivers/emac/CMakeLists.txt @@ -1,4 +1,31 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("ARM_FM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ARM_FM) +elseif("ARM_SSG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ARM_SSG) +elseif("Cypress" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Cypress) +elseif("Freescale_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Freescale_EMAC) +elseif("GD_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_GD_EMAC) +elseif("NUVOTON_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUVOTON_EMAC) +elseif("NXP_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NXP_EMAC) +elseif("RDA_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RDA_EMAC) +elseif("RENESAS_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RENESAS_EMAC) +elseif("STM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM) +elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Silicon_Labs) +endif() + +target_link_libraries(mbed-os-emac + INTERFACE + mbed-os-netsocket +) diff --git a/connectivity/drivers/emac/TARGET_ARM_FM/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_FM/CMakeLists.txt index c692f36..1667b49 100644 --- a/connectivity/drivers/emac/TARGET_ARM_FM/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_ARM_FM/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("COMPONENT") +if("LAN91C111" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_LAN91C111) +endif() diff --git a/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt index c93fac7..cd65a75 100644 --- a/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE fvp_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_ARM_SSG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_SSG/CMakeLists.txt index c692f36..5655d2c 100644 --- a/connectivity/drivers/emac/TARGET_ARM_SSG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_ARM_SSG/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("COMPONENT") +if("SMSC9220" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SMSC9220) +endif() diff --git a/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt index 8cfe8f6..98dc4e6 100644 --- a/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE smsc9220_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_Cypress/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Cypress/CMakeLists.txt index c692f36..9c46971 100644 --- a/connectivity/drivers/emac/TARGET_Cypress/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Cypress/CMakeLists.txt @@ -1,4 +1,10 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("COMPONENT") +if("SCL" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SCL) +endif() + +if("WHD" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_WHD) +endif() diff --git a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt index 37a0338..cbfdd76 100644 --- a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/interface +target_include_directories(mbed-os-emac + INTERFACE + . + ./interface ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE interface/SclSTAInterface.cpp interface/default_wifi_interface.cpp interface/scl_emac.cpp diff --git a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD/CMakeLists.txt index b654bde..3c9590b 100644 --- a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD/CMakeLists.txt @@ -1,16 +1,16 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/interface - ${CMAKE_CURRENT_SOURCE_DIR}/network - ${CMAKE_CURRENT_SOURCE_DIR}/utils +target_include_directories(mbed-os-emac + INTERFACE + . + ./interface + ./network + ./utils ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE interface/CyDhcpServer.cpp interface/WhdAccessPoint.cpp interface/WhdSTAInterface.cpp diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt index 4ed552e..60195cd 100644 --- a/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt @@ -1,14 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("K64F" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_K64F) +elseif("K66F" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_K66F) +endif() -target_include_directories(mbed-os - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE kinetis_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt index 88ef456..d5b53b7 100644 --- a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE hardware_init_MK64F12.c ) diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt index 6f17b3a..c432071 100644 --- a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE hardware_init_MK66F18.c ) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt index fa7fd90..f13277b 100644 --- a/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt @@ -1,14 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("GD32F30X" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_GD32F30X) +elseif("GD32F4XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_GD32F4XX) +endif() -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-emac + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE gd32xx_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt index 77d23a7..7441151 100644 --- a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE gd32f3_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt index 8699140..9be6fd2 100644 --- a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE gd32f4_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt index cd848dd..b5ade3e 100644 --- a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt @@ -1,14 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("M480" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_M480) +elseif("NUC472" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUC472) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE numaker_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt index 54dc656..22258df 100644 --- a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE m480_eth.c ) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt index 01f49c6..81e9941 100644 --- a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE nuc472_eth.c ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/CMakeLists.txt index f403f3a..ed27ee1 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/CMakeLists.txt @@ -1,4 +1,11 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("IMX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_IMX) +elseif("LPCTarget" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_LPCTarget) +elseif("MCU_LPC546XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_LPC546XX) +endif() + diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt index e5ec98a..ebf9f23 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt @@ -1,14 +1,16 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("MIMXRT1050_EVK" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MIMXRT1050_EVK) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE imx_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/TARGET_MIMXRT1050_EVK/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/TARGET_MIMXRT1050_EVK/CMakeLists.txt index 0dc5af2..b257c4e 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/TARGET_MIMXRT1050_EVK/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/TARGET_MIMXRT1050_EVK/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os +target_sources(mbed-os-emac PRIVATE hardware_init.c ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt index 18e92ad..2eba77a 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE lpc17_emac.cpp lpc_phy_dp83848.cpp ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt index 5df36af..cb40957 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt @@ -1,14 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("FF_LPC546XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_FF_LPC546XX) +elseif("LPCXpresso" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_LPCXpresso) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE lpc546xx_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt index 0c842df..664c2e1 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE hardware_init_LPC546XX.c ) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt index 0c842df..664c2e1 100644 --- a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE hardware_init_LPC546XX.c ) diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt index 6c63d1a..89a817b 100644 --- a/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt @@ -3,13 +3,13 @@ add_subdirectory(lwip-wifi) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-emac + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE RdaWiFiInterface.cpp rda5981x_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/CMakeLists.txt index f403f3a..0c683b6 100644 --- a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("RDA" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RDA) +endif() diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/CMakeLists.txt index f403f3a..6ec34e0 100644 --- a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("UNO_91H" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_UNO_91H) +endif() diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/CMakeLists.txt index e3be54a..d5443ae 100644 --- a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/CMakeLists.txt @@ -3,13 +3,13 @@ add_subdirectory(lib) -target_include_directories(mbed-os +target_include_directories(mbed-os-emac PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/inc + . + ./inc ) -target_sources(mbed-os +target_sources(mbed-os-emac PRIVATE src/maclib_task.c src/rda5991h_wland.c diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/lib/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/lib/CMakeLists.txt index aa09fea..dbc105c 100644 --- a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/lib/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/lib/CMakeLists.txt @@ -9,7 +9,7 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") set(LIB_FILE TOOLCHAIN_IAR/libwifi_sta_ap.a) endif() - target_sources(mbed-os PRIVATE ${LIB_FILE}) + target_sources(mbed-os-emac PRIVATE ${LIB_FILE}) endfunction() _mbed_get_lib_file_uno_91h() diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/CMakelists.txt b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/CMakelists.txt new file mode 100644 index 0000000..9a7d66a --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/CMakelists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("RZ_A1XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RZ_A1XX) +elseif("RZ_A2XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RZ_A2XX) +endif() diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakelists.txt b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakelists.txt new file mode 100644 index 0000000..17f9435 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakelists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-os-emac + INTERFACE + . +) + +target_sources(mbed-os-emac + INTERFACE + rza1_emac.cpp + rza1_eth.cpp +) diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakelists.txt b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakelists.txt new file mode 100644 index 0000000..94b4fa1 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakelists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-os-emac + PUBLIC + . + r_ether_rza2 + r_ether_rza2/src/phy + r_ether_rza2/src/targets/TARGET_GR_MANGO + PRIVATE + r_ether_rza2/src +) + +target_sources(mbed-os-emac + PRIVATE + rza2_emac.cpp + r_ether_rza2/src/r_ether_rza2.c + r_ether_rza2/src/phy/phy.c + r_ether_rza2/src/targets/TARGET_GR_MANGO/r_ether_setting_rza2m.c +) diff --git a/connectivity/drivers/emac/TARGET_RZ_A1_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RZ_A1_EMAC/CMakeLists.txt deleted file mode 100644 index 4dcbe21..0000000 --- a/connectivity/drivers/emac/TARGET_RZ_A1_EMAC/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) - -target_sources(mbed-os - PRIVATE - rza1_emac.cpp - rza1_eth.c -) diff --git a/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt index 19d88f5..d4751e1 100644 --- a/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt @@ -1,14 +1,22 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("STM32F2" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F2) +elseif("STM32F4" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F4) +elseif("STM32F7" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F7) +elseif("STM32H7" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32H7) +endif() -target_include_directories(mbed-os - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32xx_emac.cpp ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt index feef51a..3f08ed2 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt @@ -1,14 +1,16 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("NUCLEO_F207ZG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F207ZG) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f2_eth_conf.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt index 108bf00..21cd0bb 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f2_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt index f9e0d89..f8f0963 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt @@ -1,9 +1,15 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("ARCH_MAX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ARCH_MAX) +elseif("NUCLEO_F429ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F429ZI) +elseif("NUCLEO_F439ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F439ZI) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt index eabd158..8a25465 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f4_eth_conf.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt index eabd158..8a25465 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f4_eth_conf.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt index eabd158..b5c5ebf 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os +target_include_directories(mbed-os-emac PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} + . ) -target_sources(mbed-os +target_sources(mbed-os-emac PRIVATE stm32f4_eth_conf.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt index 2c93940..810324e 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt @@ -1,14 +1,24 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("DISCO_F746NG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_DISCO_F746NG) +elseif("DISCO_F769NI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_DISCO_F769NI) +elseif("NUCLEO_F746ZG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F746ZG) +elseif("NUCLEO_F756ZG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F756ZG) +elseif("NUCLEO_F767ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F767ZI) +endif() -target_include_directories(mbed-os - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f7_eth_conf.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt index ba52504..6c3e18d 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt index ba52504..6c3e18d 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt index ba52504..6c3e18d 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt index ba52504..6c3e18d 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt index ba52504..6c3e18d 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32f7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt index c227ef0..da27570 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt @@ -1,15 +1,21 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("DISCO_H747I" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_DISCO_H747I) +elseif("NUCLEO_H743ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_H743ZI) +elseif("NUCLEO_H743ZI2" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_H743ZI2) +endif() -target_include_directories(mbed-os +target_include_directories(mbed-os-emac PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/lan8742 + . + ./lan8742 ) -target_sources(mbed-os +target_sources(mbed-os-emac PRIVATE lan8742/lan8742.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt index 233efe3..57a1c73 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32h7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt index 233efe3..57a1c73 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32h7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt index 233efe3..57a1c73 100644 --- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE stm32h7_eth_init.c ) diff --git a/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt index 99354b8..b2f593f 100644 --- a/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-emac + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-emac + INTERFACE sl_emac.cpp sl_eth_hw.c ) diff --git a/connectivity/drivers/lora/CMakeLists.txt b/connectivity/drivers/lora/CMakeLists.txt index c692f36..0c382d4 100644 --- a/connectivity/drivers/lora/CMakeLists.txt +++ b/connectivity/drivers/lora/CMakeLists.txt @@ -1,4 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("COMPONENT") +if("SX126X" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SX126X) +endif() + +if("SX1272" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SX1272) +endif() + +if("SX1276" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SX1276) +endif() diff --git a/connectivity/drivers/lora/COMPONENT_SX126X/CMakeLists.txt b/connectivity/drivers/lora/COMPONENT_SX126X/CMakeLists.txt index 14b2783..c6f558e 100644 --- a/connectivity/drivers/lora/COMPONENT_SX126X/CMakeLists.txt +++ b/connectivity/drivers/lora/COMPONENT_SX126X/CMakeLists.txt @@ -1,13 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-lorawan + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-lorawan + INTERFACE SX126X_LoRaRadio.cpp ) diff --git a/connectivity/drivers/lora/COMPONENT_SX1272/CMakeLists.txt b/connectivity/drivers/lora/COMPONENT_SX1272/CMakeLists.txt index d37cfff..d8c2883 100644 --- a/connectivity/drivers/lora/COMPONENT_SX1272/CMakeLists.txt +++ b/connectivity/drivers/lora/COMPONENT_SX1272/CMakeLists.txt @@ -1,14 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/registers +target_include_directories(mbed-os-lorawan + INTERFACE + . + ./registers ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-lorawan + INTERFACE SX1272_LoRaRadio.cpp ) diff --git a/connectivity/drivers/lora/COMPONENT_SX1276/CMakeLists.txt b/connectivity/drivers/lora/COMPONENT_SX1276/CMakeLists.txt index 10dabb4..2f1959b 100644 --- a/connectivity/drivers/lora/COMPONENT_SX1276/CMakeLists.txt +++ b/connectivity/drivers/lora/COMPONENT_SX1276/CMakeLists.txt @@ -1,14 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/registers +target_include_directories(mbed-os-lorawan + INTERFACE + . + ./registers ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-lorawan + INTERFACE SX1276_LoRaRadio.cpp ) diff --git a/connectivity/drivers/mbedtls/CMakeLists.txt b/connectivity/drivers/mbedtls/CMakeLists.txt index 32c1892..cdeb1c5 100644 --- a/connectivity/drivers/mbedtls/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/CMakeLists.txt @@ -1,5 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("FEATURE") -mbed_add_cmake_directory_if_labels("TARGET") +if("CRYPTOCELL310" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(FEATURE_CRYPTOCELL310) +endif() + +if("Cypress" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Cypress) +elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUVOTON) +elseif("STM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM) +elseif("Samsung" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Samsung) +elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Silicon_Labs) +endif() diff --git a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/CMakeLists.txt b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/CMakeLists.txt index 66d0c1d..c1535a9 100644 --- a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/CMakeLists.txt @@ -1,19 +1,22 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("MCU_NRF52840" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_NRF52840) +endif() + add_subdirectory(binaries) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/cryptocell310 - ${CMAKE_CURRENT_SOURCE_DIR}/include/cryptocell310/internal +target_include_directories(mbed-os-mbedtls-cryptocell310 + INTERFACE + . + ./include + ./include/cryptocell310 + ./include/cryptocell310/internal ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls-cryptocell310 + INTERFACE source/aes_alt.c source/cc_internal.c source/ccm_alt.c @@ -25,3 +28,8 @@ source/sha512_alt.c source/trng.c ) + +target_link_libraries(mbed-os-mbedtls-cryptocell310 + INTERFACE + mbed-os-mbedtls +) diff --git a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/CMakeLists.txt b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/CMakeLists.txt index a7965ef..a92a5d8 100644 --- a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/CMakeLists.txt @@ -9,9 +9,9 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") set(LIBCC_310_EXT TOOLCHAIN_IAR/lib_cc310_ext.a) endif() - target_link_libraries(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/${LIBCC_310_EXT} + target_link_libraries(mbed-os-mbedtls-cryptocell310 + INTERFACE + ./${LIBCC_310_EXT} ) endfunction() @@ -23,21 +23,21 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") set(LIBCC_310_TRNG TOOLCHAIN_IAR/lib_cc310_trng.a) endif() - target_link_libraries(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/${LIBCC_310_TRNG} + target_link_libraries(mbed-os-mbedtls-cryptocell310 + INTERFACE + ./${LIBCC_310_TRNG} ) endfunction() _mbed_get_libcc_310_ext() _mbed_get_libcc_310_trng() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-mbedtls-cryptocell310 + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls-cryptocell310 + INTERFACE crypto_device_platform.c -) +) \ No newline at end of file diff --git a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/binaries/CMakeLists.txt b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/binaries/CMakeLists.txt index b42e0de..e78f5e2 100644 --- a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/binaries/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/binaries/CMakeLists.txt @@ -9,8 +9,8 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") set(LIBCC_310_CORE TOOLCHAIN_IAR/lib_cc310_ext.a) endif() - target_link_libraries(mbed-os - PUBLIC + target_link_libraries(mbed-os-mbedtls-cryptocell310 + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIBCC_310_CORE} ) endfunction() diff --git a/connectivity/drivers/mbedtls/TARGET_Cypress/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Cypress/CMakeLists.txt index f403f3a..3c9a910 100644 --- a/connectivity/drivers/mbedtls/TARGET_Cypress/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_Cypress/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("MXCRYPTO" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MXCRYPTO) +endif() diff --git a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/CMakeLists.txt index fafe591..6b7c574 100644 --- a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/CMakeLists.txt @@ -1,15 +1,19 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("MXCRYPTO_01" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MXCRYPTO_01) +elseif("MXCRYPTO_02" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MXCRYPTO_02) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-mbedtls + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls + INTERFACE aes_alt.c crypto_common.c ecdsa_alt.c diff --git a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_01/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_01/CMakeLists.txt index b363e2e..5d1ffa3 100644 --- a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_01/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_01/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-mbedtls + INTERFACE + . ) diff --git a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_02/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_02/CMakeLists.txt index b363e2e..5d1ffa3 100644 --- a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_02/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_02/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-mbedtls + INTERFACE + . ) diff --git a/connectivity/drivers/mbedtls/TARGET_NUVOTON/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_NUVOTON/CMakeLists.txt index f403f3a..2a28282 100644 --- a/connectivity/drivers/mbedtls/TARGET_NUVOTON/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_NUVOTON/CMakeLists.txt @@ -1,4 +1,9 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("M480" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_M480) +elseif("NUC472" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUC472) +endif() + diff --git a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt index 340f2b1..d1a0ec8 100644 --- a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt @@ -1,16 +1,16 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/aes - ${CMAKE_CURRENT_SOURCE_DIR}/des - ${CMAKE_CURRENT_SOURCE_DIR}/sha +target_include_directories(mbed-os-mbedtls + INTERFACE + . + ./aes + ./des + ./sha ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls + INTERFACE aes/aes_alt.c des/des_alt.c diff --git a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt index 09f89d8..877095d 100644 --- a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt @@ -1,18 +1,20 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("NUMAKER_PFM_NUC472" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUMAKER_PFM_NUC472) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/aes - ${CMAKE_CURRENT_SOURCE_DIR}/des - ${CMAKE_CURRENT_SOURCE_DIR}/sha +target_include_directories(mbed-os-mbedtls + INTERFACE + . + ./aes + ./des + ./sha ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls + INTERFACE aes/aes_alt.c des/des_alt.c diff --git a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/CMakeLists.txt index b363e2e..9779f8b 100644 --- a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-mbedtls + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/CMakeLists.txt index 6289b41..eef1b17 100644 --- a/connectivity/drivers/mbedtls/TARGET_STM/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_STM/CMakeLists.txt @@ -1,10 +1,26 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("TARGET_STM32F437xG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F437xG) +elseif("STM32F439xI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F439xI) +elseif("STM32F756xG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F756xG) +elseif("STM32L443xC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L443xC) +elseif("STM32L486xG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L486xG) +elseif("STM32L4S5xI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L4S5xI) +elseif("STM32L562xx" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L562xx) +elseif("STM32WB55xx" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32WB55xx) +endif() -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls + INTERFACE aes_alt.cpp aes_alt_stm32l4.c ccm_alt.cpp @@ -16,7 +32,7 @@ sha256_alt.cpp ) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-mbedtls + INTERFACE + . ) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F437xG/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F437xG/CMakeLists.txt index b363e2e..21071d8 100644 --- a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F437xG/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F437xG/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-mbedtls-stm + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F439xI/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F439xI/CMakeLists.txt index b363e2e..5d1ffa3 100644 --- a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F439xI/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F439xI/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-mbedtls + INTERFACE + . ) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F756xG/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F756xG/CMakeLists.txt index b363e2e..21071d8 100644 --- a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F756xG/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F756xG/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-mbedtls-stm + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L443xC/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L443xC/CMakeLists.txt index b363e2e..21071d8 100644 --- a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L443xC/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L443xC/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-mbedtls-stm + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L486xG/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L486xG/CMakeLists.txt index b363e2e..21071d8 100644 --- a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L486xG/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L486xG/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-mbedtls-stm + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L562xx/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L562xx/CMakeLists.txt index b363e2e..21071d8 100644 --- a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L562xx/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L562xx/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-mbedtls-stm + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32WB55xx/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32WB55xx/CMakeLists.txt index b363e2e..21071d8 100644 --- a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32WB55xx/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32WB55xx/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-mbedtls-stm + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/connectivity/drivers/mbedtls/TARGET_Samsung/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Samsung/CMakeLists.txt index ebcd365..b2bef3e 100644 --- a/connectivity/drivers/mbedtls/TARGET_Samsung/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_Samsung/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/sha +target_include_directories(mbed-os-mbedtls + INTERFACE + . + ./sha ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls + INTERFACE sha/sha256_alt.c sha/sha512_alt.c ) diff --git a/connectivity/drivers/mbedtls/TARGET_Silicon_Labs/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Silicon_Labs/CMakeLists.txt index 544ce15..f3517b5 100644 --- a/connectivity/drivers/mbedtls/TARGET_Silicon_Labs/CMakeLists.txt +++ b/connectivity/drivers/mbedtls/TARGET_Silicon_Labs/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-mbedtls + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls + INTERFACE aes_aes.c crypto_aes.c crypto_ecp.c diff --git a/connectivity/drivers/nfc/CMakeLists.txt b/connectivity/drivers/nfc/CMakeLists.txt index cadea27..214a1e0 100644 --- a/connectivity/drivers/nfc/CMakeLists.txt +++ b/connectivity/drivers/nfc/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(PN512) +if("PN512" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(PN512) +endif() diff --git a/connectivity/drivers/nfc/PN512/CMakeLists.txt b/connectivity/drivers/nfc/PN512/CMakeLists.txt index fce2e97..8cd8510 100644 --- a/connectivity/drivers/nfc/PN512/CMakeLists.txt +++ b/connectivity/drivers/nfc/PN512/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nfc + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc/controllers @@ -10,8 +10,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/source/transceiver ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nfc + INTERFACE source/PN512Driver.cpp source/PN512SPITransportDriver.cpp source/PN512TransportDriver.cpp diff --git a/connectivity/drivers/wifi/CMakeLists.txt b/connectivity/drivers/wifi/CMakeLists.txt index 12b4be6..9d09488 100644 --- a/connectivity/drivers/wifi/CMakeLists.txt +++ b/connectivity/drivers/wifi/CMakeLists.txt @@ -2,3 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 add_subdirectory(esp8266-driver) + +target_link_libraries(mbed-os-wifi + INTERFACE + mbed-os-netsocket +) diff --git a/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt b/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt index 7090927..0dcbce4 100644 --- a/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt +++ b/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-wifi + INTERFACE ESP8266Interface.cpp ESP8266/ESP8266.cpp ) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/ESP8266 +target_include_directories(mbed-os-wifi + INTERFACE + . + ./ESP8266 ) diff --git a/connectivity/libraries/mbed-coap/CMakeLists.txt b/connectivity/libraries/mbed-coap/CMakeLists.txt index 1ef107d..6e26fff 100644 --- a/connectivity/libraries/mbed-coap/CMakeLists.txt +++ b/connectivity/libraries/mbed-coap/CMakeLists.txt @@ -1,17 +1,22 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/mbed-coap - ${CMAKE_CURRENT_SOURCE_DIR}/source/include +target_include_directories(mbed-os-coap + INTERFACE + . + ./mbed-coap + ./source/include ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-coap + INTERFACE source/sn_coap_builder.c source/sn_coap_header_check.c source/sn_coap_parser.c source/sn_coap_protocol.c ) + +target_compile_definitions(mbed-os-coap + INTERFACE + MBED_CONF_COAP_PRESENT=1 +) diff --git a/connectivity/libraries/nanostack-libservice/CMakeLists.txt b/connectivity/libraries/nanostack-libservice/CMakeLists.txt index 9386bf3..3c94e27 100644 --- a/connectivity/libraries/nanostack-libservice/CMakeLists.txt +++ b/connectivity/libraries/nanostack-libservice/CMakeLists.txt @@ -1,33 +1,37 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE - mbed-client-libservice/common_functions.h - mbed-client-libservice/ip4string.h - mbed-client-libservice/ip6string.h - mbed-client-libservice/ip_fsc.h - mbed-client-libservice/ns_list.h - mbed-client-libservice/ns_nvm_helper.h - mbed-client-libservice/ns_trace.h - mbed-client-libservice/ns_types.h - mbed-client-libservice/nsdynmemLIB.h - mbed-client-libservice/platform/arm_hal_interrupt.h - mbed-client-libservice/platform/arm_hal_nvm.h - source/IPv6_fcf_lib +target_include_directories(mbed-os-nanostack-libservice + INTERFACE + . + ./mbed-client-libservice + ./mbed-client-libservice/platform +) + +target_sources(mbed-os-nanostack-libservice + INTERFACE source/IPv6_fcf_lib/ip_fsc.c - source/libBits/common_functions.c source/libList/ns_list.c - source/libTrace/scripts/fetch_groups.sh source/libip4string/ip4tos.c source/libip4string/stoip4.c - source/libip6string/ip6tos.c source/libip6string/stoip6.c source/nsdynmemLIB/nsdynmemLIB.c source/nvmHelper/ns_nvm_helper.c ) + +# The definition, source files and include directories below +# are needed by mbed-trace which is part of the mbed-os CMake target +target_compile_definitions(mbed-os + PUBLIC + MBED_CONF_NANOSTACK_LIBSERVICE_PRESENT=1 +) target_include_directories(mbed-os PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/mbed-client-libservice - ${CMAKE_CURRENT_SOURCE_DIR}/mbed-client-libservice/platform + . + ./mbed-client-libservice +) +target_sources(mbed-os + PRIVATE + source/libBits/common_functions.c + source/libip6string/ip6tos.c ) diff --git a/connectivity/libraries/ppp/CMakeLists.txt b/connectivity/libraries/ppp/CMakeLists.txt index bfacd3e..0a38c6e 100644 --- a/connectivity/libraries/ppp/CMakeLists.txt +++ b/connectivity/libraries/ppp/CMakeLists.txt @@ -1,16 +1,16 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/polarssl - ${CMAKE_CURRENT_SOURCE_DIR}/include/ppp +target_include_directories(mbed-os-ppp + INTERFACE + . + ./include + ./include/polarssl + ./include/ppp ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-ppp + INTERFACE source/auth.c source/ccp.c source/chap-md5.c @@ -45,3 +45,8 @@ source/polarssl/ppp_md5.c source/polarssl/ppp_sha1.c ) + +target_compile_definitions(mbed-os-ppp + INTERFACE + MBED_CONF_PPP_PRESENT=1 +) diff --git a/connectivity/lorawan/CMakeLists.txt b/connectivity/lorawan/CMakeLists.txt index f796edc..4ff80ae 100644 --- a/connectivity/lorawan/CMakeLists.txt +++ b/connectivity/lorawan/CMakeLists.txt @@ -4,15 +4,26 @@ add_subdirectory(lorastack) add_subdirectory(system) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/lorawan +target_include_directories(mbed-os-lorawan + INTERFACE + .. + . + ./include + ./include/lorawan ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-lorawan + INTERFACE source/LoRaWANInterface.cpp source/LoRaWANStack.cpp ) + +target_compile_definitions(mbed-os-lorawan + INTERFACE + MBED_CONF_LORAWAN_PRESENT=1 +) + +target_link_libraries(mbed-os-lorawan + INTERFACE + mbed-os-events +) diff --git a/connectivity/lorawan/lorastack/CMakeLists.txt b/connectivity/lorawan/lorastack/CMakeLists.txt index d083413..ff12bf8 100644 --- a/connectivity/lorawan/lorastack/CMakeLists.txt +++ b/connectivity/lorawan/lorastack/CMakeLists.txt @@ -1,15 +1,15 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-lorawan + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/mac ${CMAKE_CURRENT_SOURCE_DIR}/phy ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-lorawan + INTERFACE mac/LoRaMac.cpp mac/LoRaMacChannelPlan.cpp mac/LoRaMacCommand.cpp diff --git a/connectivity/lorawan/system/CMakeLists.txt b/connectivity/lorawan/system/CMakeLists.txt index 32c7253..14bbb64 100644 --- a/connectivity/lorawan/system/CMakeLists.txt +++ b/connectivity/lorawan/system/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-lorawan + INTERFACE LoRaWANTimer.cpp ) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-lorawan + INTERFACE + . ) diff --git a/connectivity/lwipstack/CMakeLists.txt b/connectivity/lwipstack/CMakeLists.txt index e51efaf..bf35903 100644 --- a/connectivity/lwipstack/CMakeLists.txt +++ b/connectivity/lwipstack/CMakeLists.txt @@ -1,19 +1,19 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/lwipstack - ${CMAKE_CURRENT_SOURCE_DIR}/lwip/src/include - ${CMAKE_CURRENT_SOURCE_DIR}/lwip/src/include/lwip - ${CMAKE_CURRENT_SOURCE_DIR}/lwip-sys - ${CMAKE_CURRENT_SOURCE_DIR}/lwip-sys/arch +target_include_directories(mbed-os-lwipstack + INTERFACE + . + ./include + ./include/lwipstack + ./lwip/src/include + ./lwip/src/include/lwip + ./lwip-sys + ./lwip-sys/arch ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-lwipstack + INTERFACE lwip/src/api/lwip_api_lib.c lwip/src/api/lwip_api_msg.c lwip/src/api/lwip_err.c @@ -86,3 +86,15 @@ source/LWIPStack.cpp source/lwip_tools.cpp ) + +target_compile_definitions(mbed-os-lwipstack + INTERFACE + MBED_CONF_LWIPSTACK_PRESENT=1 +) + +target_link_libraries(mbed-os-lwipstack + INTERFACE + mbed-os-netsocket + mbed-os-ppp + mbed-os-randlib +) diff --git a/connectivity/mbedtls/CMakeLists.txt b/connectivity/mbedtls/CMakeLists.txt index d949865..4fd7643 100644 --- a/connectivity/mbedtls/CMakeLists.txt +++ b/connectivity/mbedtls/CMakeLists.txt @@ -1,17 +1,17 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls - ${CMAKE_CURRENT_SOURCE_DIR}/platform - ${CMAKE_CURRENT_SOURCE_DIR}/platform/inc +target_include_directories(mbed-os-mbedtls + INTERFACE + . + ./include + ./include/mbedtls + ./platform + ./platform/inc ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-mbedtls + INTERFACE platform/src/mbed_trng.cpp platform/src/platform_alt.cpp platform/src/shared_rng.cpp @@ -97,3 +97,8 @@ source/x509write_csr.c source/xtea.c ) + +target_compile_definitions(mbed-os-mbedtls + INTERFACE + MBED_CONF_MBEDTLS_PRESENT=1 +) diff --git a/connectivity/nanostack/CMakeLists.txt b/connectivity/nanostack/CMakeLists.txt index f2ea557..3417413 100644 --- a/connectivity/nanostack/CMakeLists.txt +++ b/connectivity/nanostack/CMakeLists.txt @@ -7,14 +7,26 @@ add_subdirectory(sal-stack-nanostack) add_subdirectory(sal-stack-nanostack-eventloop) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/nanostack-interface +target_include_directories(mbed-os-nanostack + INTERFACE + . + ./include + ./include/nanostack-interface ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack + INTERFACE source/Nanostack.cpp ) + +target_compile_definitions(mbed-os-nanostack + INTERFACE + MBED_CONF_NANOSTACK_PRESENT=1 +) + +target_link_libraries(mbed-os-nanostack + INTERFACE + mbed-os-nanostack-mbed_mesh_api + mbed-os-nanostack-sal_stack-event_loop + mbed-os-nanostack-sal_stack +) diff --git a/connectivity/nanostack/coap-service/CMakeLists.txt b/connectivity/nanostack/coap-service/CMakeLists.txt index 575a7cc..ce17dee 100644 --- a/connectivity/nanostack/coap-service/CMakeLists.txt +++ b/connectivity/nanostack/coap-service/CMakeLists.txt @@ -1,17 +1,22 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/coap-service - ${CMAKE_CURRENT_SOURCE_DIR}/source/include +target_include_directories(mbed-os-nanostack-coap_service + INTERFACE + . + ./coap-service + ./source/include ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-coap_service + INTERFACE source/coap_connection_handler.c source/coap_message_handler.c source/coap_security_handler.c source/coap_service_api.c ) + +target_link_libraries(mbed-os-nanostack + INTERFACE + mbed-os-coap +) diff --git a/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt b/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt index ad495f0..b9c1935 100644 --- a/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt +++ b/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt @@ -1,15 +1,15 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/mbed-mesh-api - ${CMAKE_CURRENT_SOURCE_DIR}/source/include +target_include_directories(mbed-os-nanostack-mbed_mesh_api + INTERFACE + . + ./mbed-mesh-api + ./source/include ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-mbed_mesh_api + INTERFACE source/CallbackHandler.cpp source/LoWPANNDInterface.cpp source/MeshInterfaceNanostack.cpp @@ -26,3 +26,8 @@ source/thread_tasklet.c source/wisun_tasklet.c ) + +target_link_libraries(mbed-os-nanostack + INTERFACE + mbed-os-nanostack-hal_mbed_cmsis_rtos +) diff --git a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt index 78f8aac..ba5e00c 100644 --- a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt +++ b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt @@ -1,14 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(mbed-os-nanostack-hal_mbed_cmsis_rtos + INTERFACE + . ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-hal_mbed_cmsis_rtos + INTERFACE arm_hal_fhss_timer.cpp arm_hal_interrupt.c arm_hal_random.c diff --git a/connectivity/nanostack/sal-stack-nanostack-eventloop/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack-eventloop/CMakeLists.txt index dc914e5..5021325 100644 --- a/connectivity/nanostack/sal-stack-nanostack-eventloop/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack-eventloop/CMakeLists.txt @@ -1,15 +1,15 @@ # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/nanostack-event-loop - ${CMAKE_CURRENT_SOURCE_DIR}/nanostack-event-loop/platform - ${CMAKE_CURRENT_SOURCE_DIR}/source +target_include_directories(mbed-os-nanostack-sal_stack-event_loop + INTERFACE + . + ./nanostack-event-loop + ./nanostack-event-loop/platform + ./source ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack-event_loop + INTERFACE source/event.c source/ns_timeout.c source/ns_timer.c diff --git a/connectivity/nanostack/sal-stack-nanostack/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/CMakeLists.txt index 16837da..c76dd23 100644 --- a/connectivity/nanostack/sal-stack-nanostack/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/CMakeLists.txt @@ -19,10 +19,15 @@ add_subdirectory(source/libDHCPv6) add_subdirectory(source/libNET) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/nanostack - ${CMAKE_CURRENT_SOURCE_DIR}/nanostack/platform - ${CMAKE_CURRENT_SOURCE_DIR}/source +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE + . + ./nanostack + ./nanostack/platform + ./source +) + +target_link_libraries(mbed-os-nanostack + INTERFACE + mbed-os-nanostack-coap_service ) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/CMakeLists.txt index fc26c257..11cabd8 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Bootstraps ${CMAKE_CURRENT_SOURCE_DIR}/Fragmentation @@ -15,8 +15,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/ws ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE adaptation_interface.c Bootstraps/Generic/network_lib.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/BorderRouter/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/BorderRouter/CMakeLists.txt index acf443c..f5db88a 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/BorderRouter/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/BorderRouter/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE border_router.c ) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Common_Protocols/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Common_Protocols/CMakeLists.txt index 3325522..334b076 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/Common_Protocols/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/Common_Protocols/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE icmpv6.c icmpv6_prefix.c icmpv6_radv.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Core/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Core/CMakeLists.txt index 28361ac..772b618 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/Core/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/Core/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE buffer_dyn.c ns_address_internal.c ns_monitor.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_Server/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_Server/CMakeLists.txt index 6beb3fa..1546622 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_Server/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_Server/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE DHCPv6_Server_service.c ) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_client/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_client/CMakeLists.txt index a6c33ce..9bc1f69 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_client/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_client/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE dhcpv6_client_service.c ) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/MAC/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/MAC/CMakeLists.txt index e3d736b..7cfa892 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/MAC/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/MAC/CMakeLists.txt @@ -1,15 +1,15 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/IEEE802_15_4 ${CMAKE_CURRENT_SOURCE_DIR}/virtual_rf ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE rf_driver_storage.c IEEE802_15_4/mac_cca_threshold.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/MLE/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/MLE/CMakeLists.txt index 0bda901..c06b67e 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/MLE/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/MLE/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE mle.c mle_tlv.c ) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/MPL/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/MPL/CMakeLists.txt index e10b4ee..7c63092 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/MPL/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/MPL/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE mpl.c ) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/CMakeLists.txt index 59d94da..b72ddcd 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Include ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE protocol_core.c protocol_core_sleep.c protocol_stats.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/RPL/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/RPL/CMakeLists.txt index d726b71..1e45b6c 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/RPL/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/RPL/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE rpl_control.c rpl_data.c rpl_downward.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Security/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Security/CMakeLists.txt index 350c83e..4b3ad22 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/Security/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/Security/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Common ${CMAKE_CURRENT_SOURCE_DIR}/PANA @@ -18,8 +18,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/protocols/tls_sec_prot ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE Common/security_lib.c PANA/eap_protocol.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt index 5fefc61..4772db8 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Neighbor_cache ${CMAKE_CURRENT_SOURCE_DIR}/Trickle @@ -34,8 +34,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/whiteboard ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE CCM_lib/ccm_security.c CCM_lib/mbedOS/aes_mbedtls_adapter.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/configs/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/configs/CMakeLists.txt index 45cc452..5ca67f5 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/configs/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/configs/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/base ) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/ipv6_stack/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/ipv6_stack/CMakeLists.txt index 4132ccb..1ad97e4 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/ipv6_stack/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/ipv6_stack/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE ipv6_routing_table.c protocol_ipv6.c ) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/libDHCPv6/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/libDHCPv6/CMakeLists.txt index e2523c0..0140210 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/libDHCPv6/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/libDHCPv6/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE dhcp_service_api.c libDHCPv6.c libDHCPv6_server.c diff --git a/connectivity/nanostack/sal-stack-nanostack/source/libNET/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/libNET/CMakeLists.txt index 4992797..38f5d77 100644 --- a/connectivity/nanostack/sal-stack-nanostack/source/libNET/CMakeLists.txt +++ b/connectivity/nanostack/sal-stack-nanostack/source/libNET/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nanostack-sal_stack + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nanostack-sal_stack + INTERFACE src/multicast_api.c src/net_6lowpan_parameter_api.c src/net_dns.c diff --git a/connectivity/netsocket/CMakeLists.txt b/connectivity/netsocket/CMakeLists.txt index fae480d..eabee69 100644 --- a/connectivity/netsocket/CMakeLists.txt +++ b/connectivity/netsocket/CMakeLists.txt @@ -1,16 +1,21 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/netsocket +# TODO CMake: Perhaps move this/these file(s) +target_sources(mbed-os-cellular + INTERFACE + source/CellularNonIPSocket.cpp ) -target_sources(mbed-os - PRIVATE - source/CellularNonIPSocket.cpp +target_include_directories(mbed-os-netsocket + INTERFACE + . + ./include + ./include/netsocket +) + +target_sources(mbed-os-netsocket + INTERFACE source/DTLSSocket.cpp source/DTLSSocketWrapper.cpp source/EMACInterface.cpp @@ -34,3 +39,29 @@ source/nsapi_dns.cpp source/nsapi_ppp.cpp ) + +target_compile_definitions(mbed-os-netsocket + INTERFACE + MBED_CONF_NETSOCKET_PRESENT=1 + MBED_CONF_CMAKE_NETSOCKET_ENABLED=1 +) + +target_link_libraries(mbed-os-netsocket + INTERFACE + mbed-os-mbedtls + mbed-os-lwipstack + mbed-os-events +) + +if("DEVICE_EMAC=1" IN_LIST MBED_TARGET_DEFINITIONS) + target_link_libraries(mbed-os-netsocket + INTERFACE + mbed-os-emac + ) +endif() + +target_link_libraries(mbed-os-netsocket + INTERFACE + mbed-os-cellular + mbed-os-nanostack-libservice +) diff --git a/connectivity/nfc/CMakeLists.txt b/connectivity/nfc/CMakeLists.txt index ccb1ee1..bb6d365 100644 --- a/connectivity/nfc/CMakeLists.txt +++ b/connectivity/nfc/CMakeLists.txt @@ -3,8 +3,8 @@ add_subdirectory(libraries) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nfc + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc @@ -12,8 +12,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc/ndef/common ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nfc + INTERFACE source/NFCController.cpp source/NFCControllerDriver.cpp source/NFCEEPROM.cpp @@ -34,3 +34,13 @@ source/ndef/common/URI.cpp source/ndef/common/util.cpp ) + +target_compile_definitions(mbed-os-nfc + INTERFACE + MBED_CONF_NFC_PRESENT=1 +) + +target_link_libraries(mbed-os-nfc + INTERFACE + mbed-os-events +) diff --git a/connectivity/nfc/libraries/CMakeLists.txt b/connectivity/nfc/libraries/CMakeLists.txt index 37d58a4..b578be0 100644 --- a/connectivity/nfc/libraries/CMakeLists.txt +++ b/connectivity/nfc/libraries/CMakeLists.txt @@ -4,7 +4,7 @@ add_subdirectory(acore) add_subdirectory(stack) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nfc + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/connectivity/nfc/libraries/acore/CMakeLists.txt b/connectivity/nfc/libraries/acore/CMakeLists.txt index 73cc5bf..077b06f 100644 --- a/connectivity/nfc/libraries/acore/CMakeLists.txt +++ b/connectivity/nfc/libraries/acore/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nfc + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/acore ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nfc + INTERFACE source/ac_buffer.c source/ac_buffer_builder.c source/ac_buffer_reader.c diff --git a/connectivity/nfc/libraries/stack/CMakeLists.txt b/connectivity/nfc/libraries/stack/CMakeLists.txt index 8095e64..ab48192 100644 --- a/connectivity/nfc/libraries/stack/CMakeLists.txt +++ b/connectivity/nfc/libraries/stack/CMakeLists.txt @@ -4,15 +4,15 @@ add_subdirectory(tech) add_subdirectory(transceiver) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nfc + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/ndef ${CMAKE_CURRENT_SOURCE_DIR}/platform ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nfc + INTERFACE ndef/ndef.c platform/nfc_scheduler.c diff --git a/connectivity/nfc/libraries/stack/tech/CMakeLists.txt b/connectivity/nfc/libraries/stack/tech/CMakeLists.txt index 0ed68b6..a0410a5 100644 --- a/connectivity/nfc/libraries/stack/tech/CMakeLists.txt +++ b/connectivity/nfc/libraries/stack/tech/CMakeLists.txt @@ -1,16 +1,15 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nfc + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/iso7816 ${CMAKE_CURRENT_SOURCE_DIR}/isodep ${CMAKE_CURRENT_SOURCE_DIR}/type4 ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nfc + INTERFACE iso7816/iso7816.c iso7816/iso7816_app.c diff --git a/connectivity/nfc/libraries/stack/transceiver/CMakeLists.txt b/connectivity/nfc/libraries/stack/transceiver/CMakeLists.txt index a9507ec..10cdd36 100644 --- a/connectivity/nfc/libraries/stack/transceiver/CMakeLists.txt +++ b/connectivity/nfc/libraries/stack/transceiver/CMakeLists.txt @@ -1,12 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-nfc + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-nfc + INTERFACE transceiver.c ) diff --git a/docs/design-documents/tools/cmake_components.md b/docs/design-documents/tools/cmake_components.md new file mode 100644 index 0000000..cce27c1 --- /dev/null +++ b/docs/design-documents/tools/cmake_components.md @@ -0,0 +1,136 @@ +# Creating components with CMake + +One of the main goals to achieve with CMake is to have components in Mbed OS. A modular built allowing users to select what they require, not building everything as we used to with old tools. + +## Components in Mbed OS (bare-metal) + +Mbed OS consist of: +- cmsis +- rtos-api +- drivers +- platform +- hal +- targets + +Their dependencies: + +cmsis: +None + +drivers: +- platform +- rtos-api +- hal +- targets +- events + +rtos-api: +- targets +- platform + +platform: +- rtos-api +- hal +- targets + +hal: +- targets + +targets: +- hal +- drivers +- platform +- rtos-api +- cmsis + +Breaking the dependencies would be a huge effort and it possibly would result in rewriting these components as they were for years considered as monolitic - having everything available. + +## Components as object libraries + +CMake provides OBJECT libraries but it does not support circular dependencies that we have in our tree. Therefore we build Mbed OS as whole (all object files combined). + +## One object library "mbed-os" + +Our current approach on feature-cmake branch is to use OBJECT libraries. We built almost entire tree of Mbed OS, the number of object files is big. As result building take longer and we have again windows path limitation (one file compilation command is more than 43k characters long). + +To address the problem, CMake provides response files. They do not work out of the box as we experienced. Generators support them but they contain bugs. We found at least two bugs in CMake itself (Ninja, Make tested with Gcc Arm and ARMClang). We are still possibly having issues with other generators (more testing is required). + +Note, we shall use response files with static libraries or any other solution we choose to avoid path limitation in OS. + +These bugs will be fixed eventually. However, we still have not addressed the main problem - there are too many objects files to compile. We need a solution to split the tree into components and built only what is required. Therefore response files could be considered as a workaround for now until we get components in CMake. + +## Only core libraries built as objects + +These components would form mbed-os library built as OBJECT library in CMake: +- cmsis +- events +- rtos-api +- drivers +- hal +- targets +- platform + +The rest of components and features could be static or object libraries. They could be selected by a user and be added on request. + +## Components as static libraries + +It is a known problem that weakly linked symbols are not resolved with strong symbols with static libraries. We won't disallow linking with static libraries, just internal Mbed OS components should be object libraries to avoid the problem with weakly symbols as many of the components rely on them. + +### Using whole-archive to workaround weak symbols limitation + +Toolchains provide a flag to enforce keeping symbols (GCC --whole-archive, clang -force_load). See the issue with forcing linker flag to the components https://github.com/zephyrproject-rtos/zephyr/issues/8441 and https://github.com/zephyrproject-rtos/zephyr/issues/6961 for details. This has drawbacks that will need more research. See also CMake issue https://gitlab.kitware.com/cmake/cmake/-/issues/20078 - not simple to fix in CMake. + +`whole-archive` is only available to Gcc Arm, ARMClang does not provide it. + +### Removing weak symbols + +We could find alternative to weak symbols and fix them in our tree one by one. It was already achieved in Mbed OS 3 where we did not support weak symbols. + +### Object files for files with weak symbols + +Mbed 2 was released as a library, we provided object files for files that were providing weak symbols (retarget, file handling and others). They were linked together with the mbed library. This however might not be achievable (its implementation in CMake might contain hacks to get other components paths and flags as retarget file depends on multiple other components). + +## External components + +They can be either object or static library. Only one limitation due to selecting object library is that any component linked by an application shall not have circular dependencies between the components (CMake will issue an error that we are linking with an object library (`mbed-os`) and it does not support it - this will be fixed but no ETA given). + +## Solution: Mbed-os components + +mbed-os component (object library) consists of: +- cmsis +- events +- rtos-api +- drivers +- hal +- targets +- platform + +The rest of the tree is formed by components. + +Each component creates a new CMake library and adds includes/sources: + +``` +add_library(mbed-os-nanostack INTERFACE) + +target_include_directories(mbed-os-nanostack + INTERFACE + include +) + +target_sources(mbed-os-nanostack + INTERFACE + file.c +) +``` + +If there are dependencies for a component, use `target_link_libraries`. For instance, nanostack depends on 4 other components: + +``` +target_link_libraries(mbed-os-nanostack INTERFACE mbed-os-nanostack-libservice mbed-os-netsocket mbed-os-coap) +``` + +An application just links to what is required: + +``` +target_link_libraries(mbed-os-example-nanostack-example mbed-os-nanostack mbed-os) +``` diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index 6aaba5b..f0add74 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -1,14 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(device_key) - target_include_directories(mbed-os PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/drivers - ${CMAKE_CURRENT_SOURCE_DIR}/include/drivers/internal + . + ./include + ./include/drivers + ./include/drivers/internal ) target_sources(mbed-os @@ -34,7 +32,6 @@ source/PwmOut.cpp source/QSPI.cpp source/ResetReason.cpp - source/SFDP.cpp source/SPI.cpp source/SPISlave.cpp source/SerialBase.cpp @@ -45,23 +42,5 @@ source/TimerEvent.cpp source/UnbufferedSerial.cpp source/Watchdog.cpp - - source/usb/AsyncOp.cpp - source/usb/ByteBuffer.cpp - source/usb/EndpointResolver.cpp - source/usb/LinkedListBase.cpp - source/usb/OperationListBase.cpp - source/usb/PolledQueue.cpp - source/usb/TaskBase.cpp - source/usb/USBAudio.cpp - source/usb/USBCDC.cpp - source/usb/USBCDC_ECM.cpp - source/usb/USBDevice.cpp - source/usb/USBHID.cpp - source/usb/USBKeyboard.cpp - source/usb/USBMIDI.cpp - source/usb/USBMSD.cpp - source/usb/USBMouse.cpp - source/usb/USBMouseKeyboard.cpp - source/usb/USBSerial.cpp ) + diff --git a/drivers/device_key/CMakeLists.txt b/drivers/device_key/CMakeLists.txt index 07de114..d646a4a 100644 --- a/drivers/device_key/CMakeLists.txt +++ b/drivers/device_key/CMakeLists.txt @@ -1,13 +1,21 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/device_key +# This is specific driver for mbed-os-storage, it is not part of mbed-os target. +# TODO CMake: Perhaps move this/these file(s) +target_include_directories(mbed-os-device_key + INTERFACE + ./include + ./include/device_key ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-device_key + INTERFACE source/DeviceKey.cpp + ../source/SFDP.cpp +) + +target_link_libraries(mbed-os-device_key + INTERFACE + mbed-os-storage-kvstore ) diff --git a/drivers/source/usb/CMakeLists.txt b/drivers/source/usb/CMakeLists.txt new file mode 100644 index 0000000..cd8e908 --- /dev/null +++ b/drivers/source/usb/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This is specific driver for mbed-os-usb, it is not part of mbed-os target. + +add_library(mbed-os-usb INTERFACE) + +target_include_directories(mbed-os-usb + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-os-usb + INTERFACE + AsyncOp.cpp + ByteBuffer.cpp + EndpointResolver.cpp + LinkedListBase.cpp + OperationListBase.cpp + PolledQueue.cpp + TaskBase.cpp + USBAudio.cpp + USBCDC.cpp + USBCDC_ECM.cpp + USBDevice.cpp + USBHID.cpp + USBKeyboard.cpp + USBMIDI.cpp + USBMSD.cpp + USBMouse.cpp + USBMouseKeyboard.cpp + USBSerial.cpp +) + +target_link_libraries(mbed-os-usb INTERFACE mbed-os-storage) diff --git a/events/CMakeLists.txt b/events/CMakeLists.txt index 170eecd..372f23b 100644 --- a/events/CMakeLists.txt +++ b/events/CMakeLists.txt @@ -1,19 +1,27 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +add_library(mbed-os-events INTERFACE) + +target_include_directories(mbed-os-events + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/events ${CMAKE_CURRENT_SOURCE_DIR}/include/events/internal ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-events + INTERFACE source/EventQueue.cpp source/equeue.c source/equeue_mbed.cpp source/equeue_posix.c source/mbed_shared_queues.cpp ) + +target_compile_definitions(mbed-os-events + INTERFACE + MBED_CONF_EVENTS_PRESENT=1 + MBED_CONF_CMAKE_EVENTS_ENABLED +) diff --git a/features/CMakeLists.txt b/features/CMakeLists.txt index 33aeb0a..b40e167 100644 --- a/features/CMakeLists.txt +++ b/features/CMakeLists.txt @@ -1,11 +1,9 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("FEATURE") +# List of all features libraries available. +add_library(mbed-os-fpga-ci-test-shield INTERFACE) +add_library(mbed-os-client-cli INTERFACE) +add_subdirectory(frameworks/COMPONENT_FPGA_CI_TEST_SHIELD) add_subdirectory(frameworks/mbed-client-cli) - -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) diff --git a/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt b/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt new file mode 100644 index 0000000..362bcff --- /dev/null +++ b/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-os-fpga-ci-test-shield + INTERFACE + include + include/fpga_ci_test_shield +) + +target_sources(mbed-os-fpga-ci-test-shield + INTERFACE + source/DynamicPinList.cpp + source/I2CTester.cpp + source/MbedTester.cpp + source/SPIMasterTester.cpp + source/SPISlaveTester.cpp + source/SPITester.cpp + source/UARTTester.cpp +) diff --git a/features/frameworks/mbed-client-cli/CMakeLists.txt b/features/frameworks/mbed-client-cli/CMakeLists.txt index e698342..f58f213 100644 --- a/features/frameworks/mbed-client-cli/CMakeLists.txt +++ b/features/frameworks/mbed-client-cli/CMakeLists.txt @@ -1,13 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/mbed-client-cli +target_include_directories(mbed-os-client-cli + INTERFACE + . + ./mbed-client-cli ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-client-cli + INTERFACE source/ns_cmdline.c ) + +target_link_libraries(mbed-os-client-cli + INTERFACE + mbed-os-nanostack-libservice +) diff --git a/mbed.h b/mbed.h index 8ed6178..c4d8b74 100644 --- a/mbed.h +++ b/mbed.h @@ -19,20 +19,22 @@ #include "platform/mbed_version.h" -#if MBED_CONF_RTOS_API_PRESENT +// MBED_CONF_CMAKE is temporary until tools do not set _PRESENT macros + +#if defined(MBED_CONF_RTOS_PRESENT) && defined(MBED_CONF_CMAKE_RTOS_ENABLED) #include "rtos/rtos.h" #endif -#if MBED_CONF_NSAPI_PRESENT +#if defined(MBED_CONF_NETSOCKET_PRESENT) && defined(MBED_CONF_CMAKE_NETSOCKET_ENABLED) #include "netsocket/nsapi.h" #include "netsocket/nsapi_ppp.h" #endif -#if MBED_CONF_EVENTS_PRESENT +#if defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_CMAKE_EVENTS_ENABLED) #include "events/mbed_events.h" #endif -#if MBED_CONF_FILESYSTEM_PRESENT +#if defined(MBED_CONF_FILESYSTEM_PRESENT) && defined(MBED_CONF_CMAKE_FILESYSTEM_ENABLED) #include "filesystem/mbed_filesystem.h" #endif diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt index 38ac18e..404c054 100644 --- a/platform/CMakeLists.txt +++ b/platform/CMakeLists.txt @@ -1,7 +1,9 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("FEATURE") +# List of all optional platform libraries available. +add_library(mbed-os-psa INTERFACE) + add_subdirectory(cxxsupport) add_subdirectory(mbed-trace) diff --git a/platform/FEATURE_EXPERIMENTAL_API/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/CMakeLists.txt index 9384ae5..c041249 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("FEATURE") +if("PSA" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(FEATURE_PSA) +endif() diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt index 5e1c494..0a620d3 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt @@ -1,15 +1,27 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("MBED_PSA_SRV" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MBED_PSA_SRV) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/inc - ${CMAKE_CURRENT_SOURCE_DIR}/inc/psa +if("TFM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM) +endif() + +target_include_directories(mbed-os-psa + INTERFACE + ./inc + ./inc/psa ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE src/psa_hrng.c ) + +target_link_libraries(mbed-os-psa + INTERFACE + mbed-os-mbedtls + mbed-os-storage-kvstore +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/CMakeLists.txt index 9cda1ff..a6476df 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/CMakeLists.txt @@ -3,16 +3,16 @@ add_subdirectory(services) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/inc - ${CMAKE_CURRENT_SOURCE_DIR}/inc/psa - ${CMAKE_CURRENT_SOURCE_DIR}/mbedtls - ${CMAKE_CURRENT_SOURCE_DIR}/pal +target_include_directories(mbed-os-psa + INTERFACE + ./inc + ./inc/psa + ./mbedtls + ./pal ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE mbedtls/psa_crypto.c mbedtls/psa_crypto_se.c mbedtls/psa_crypto_slot_management.c diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/CMakeLists.txt index 21909d8..bdf169f 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/CMakeLists.txt @@ -4,13 +4,13 @@ add_subdirectory(attestation) add_subdirectory(storage) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-psa + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/platform ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE platform/platform_emul.c platform/platform_srv_impl.c ) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/attestation/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/attestation/CMakeLists.txt index fc1b40a..4ed8c41 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/attestation/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/attestation/CMakeLists.txt @@ -1,19 +1,19 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/qcbor - ${CMAKE_CURRENT_SOURCE_DIR}/qcbor/inc - ${CMAKE_CURRENT_SOURCE_DIR}/qcbor/src - ${CMAKE_CURRENT_SOURCE_DIR}/tfm_impl - ${CMAKE_CURRENT_SOURCE_DIR}/tfm_impl/t_cose/inc - ${CMAKE_CURRENT_SOURCE_DIR}/tfm_impl/t_cose/src +target_include_directories(mbed-os-psa + INTERFACE + . + ./qcbor + ./qcbor/inc + ./qcbor/src + ./tfm_impl + ./tfm_impl/t_cose/inc + ./tfm_impl/t_cose/src ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE attest_boot_status_loader.c attest_crypto.c attest_crypto_keys.c diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/storage/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/storage/CMakeLists.txt index f1f4916..b60f74d 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/storage/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/storage/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/common - ${CMAKE_CURRENT_SOURCE_DIR}/its +target_include_directories(mbed-os-psa + INTERFACE + ./common + ./its ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE common/psa_storage_common_impl.cpp its/pits_impl.cpp diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/CMakeLists.txt index f403f3a..0608fb1 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/CMakeLists.txt @@ -1,4 +1,10 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("TFM_V1_0" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_V1_0) +endif() + +if("TFM_V1_1" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_V1_1) +endif() diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/CMakeLists.txt index d267262..e0f9b21 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/CMakeLists.txt @@ -1,17 +1,23 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("TFM_DUALCPU" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_DUALCPU) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/psa - ${CMAKE_CURRENT_SOURCE_DIR}/include/psa_manifest +if("TFM_V8M" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_V8M) +endif() + +target_include_directories(mbed-os-psa + INTERFACE + ./include + ./include/psa + ./include/psa_manifest ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE src/tfm_crypto_ipc_api.c src/tfm_initial_attestation_ipc_api.c src/tfm_its_ipc_api.c diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_DUALCPU/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_DUALCPU/CMakeLists.txt index ee4974a..c8dc122 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_DUALCPU/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_DUALCPU/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE src/platform_multicore.c src/platform_ns_mailbox.c src/tfm_mbed_boot.c diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_V8M/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_V8M/CMakeLists.txt index 54ff7ae..edcbc9d 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_V8M/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_V8M/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE src/cmsis_nvic_virtual.c src/tfm_mbed_boot.c src/tfm_ns_interface.c diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/CMakeLists.txt index f34118b..7c766e5 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/CMakeLists.txt @@ -1,17 +1,23 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("TFM_DUALCPU" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_DUALCPU) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/psa - ${CMAKE_CURRENT_SOURCE_DIR}/include/psa_manifest +if("TFM_V8M" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_V8M) +endif() + +target_include_directories(mbed-os-psa + INTERFACE + ./include + ./include/psa + ./include/psa_manifest ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE src/tfm_crypto_ipc_api.c src/tfm_initial_attestation_ipc_api.c src/tfm_its_ipc_api.c diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/CMakeLists.txt index ee4974a..c8dc122 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE src/platform_multicore.c src/platform_ns_mailbox.c src/tfm_mbed_boot.c diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_V8M/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_V8M/CMakeLists.txt index 54ff7ae..edcbc9d 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_V8M/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_V8M/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-psa + INTERFACE src/cmsis_nvic_virtual.c src/tfm_mbed_boot.c src/tfm_ns_interface.c diff --git a/platform/randlib/CMakeLists.txt b/platform/randlib/CMakeLists.txt index 3d5408c..9d182b5 100644 --- a/platform/randlib/CMakeLists.txt +++ b/platform/randlib/CMakeLists.txt @@ -1,14 +1,21 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +add_library(mbed-os-randlib INTERFACE) + +target_include_directories(mbed-os-randlib + INTERFACE include include/mbed-client-randlib include/mbed-client-randlib/platform ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-randlib + INTERFACE source/randLIB.c ) + +target_link_libraries(mbed-os-randlib + INTERFACE + mbed-os-nanostack +) diff --git a/platform/source/CMakeLists.txt b/platform/source/CMakeLists.txt index e6a2b40..360bb92 100644 --- a/platform/source/CMakeLists.txt +++ b/platform/source/CMakeLists.txt @@ -1,7 +1,12 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("TARGET") +if("CORTEX_A" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CORTEX_A) +elseif("CORTEX_M" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CORTEX_M) +endif() + add_subdirectory(minimal-printf) target_include_directories(mbed-os diff --git a/rtos/CMakeLists.txt b/rtos/CMakeLists.txt index 01696a4..4860e14 100644 --- a/rtos/CMakeLists.txt +++ b/rtos/CMakeLists.txt @@ -20,3 +20,9 @@ source/ThisThread.cpp source/Thread.cpp ) + +target_compile_definitions(mbed-os + PUBLIC + MBED_CONF_RTOS_PRESENT=1 + MBED_CONF_CMAKE_RTOS_ENABLED=1 +) diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt index e35fcee..e0d37e7 100644 --- a/storage/CMakeLists.txt +++ b/storage/CMakeLists.txt @@ -1,12 +1,37 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# List of all storage libraries available. +add_library(mbed-os-storage INTERFACE) + +add_library(mbed-os-storage-blockdevice INTERFACE) +add_library(mbed-os-storage-dataflash INTERFACE) +add_library(mbed-os-storage-flashiap INTERFACE) +add_library(mbed-os-storage-i2cee INTERFACE) +add_library(mbed-os-storage-qspif INTERFACE) +add_library(mbed-os-storage-sd INTERFACE) +add_library(mbed-os-storage-spif INTERFACE) + +add_library(mbed-os-storage-filesystem INTERFACE) +add_library(mbed-os-storage-littlefs-v2 INTERFACE) +add_library(mbed-os-storage-littlefs INTERFACE) +add_library(mbed-os-storage-fat INTERFACE) + +add_library(mbed-os-storage-kvstore INTERFACE) + + add_subdirectory(blockdevice) add_subdirectory(filesystem) add_subdirectory(kvstore) add_subdirectory(platform) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) \ No newline at end of file +target_include_directories(mbed-os-storage + INTERFACE + . +) + +target_compile_definitions(mbed-os-storage + INTERFACE + MBED_CONF_FILESYSTEM_PRESENT=1 + MBED_CONF_CMAKE_FILESYSTEM_ENABLED=1 +) diff --git a/storage/blockdevice/CMakeLists.txt b/storage/blockdevice/CMakeLists.txt index 84c7ddf..5ed9687 100644 --- a/storage/blockdevice/CMakeLists.txt +++ b/storage/blockdevice/CMakeLists.txt @@ -1,17 +1,40 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -mbed_add_cmake_directory_if_labels("COMPONENT") +if("DATAFLASH" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_DATAFLASH) +endif() -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/blockdevice +if("FLASHIAP" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_FLASHIAP) +endif() + +if("I2CEE" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_I2CEE) +endif() + +if("QSPIF" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_QSPIF) +endif() + +if("SD" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SD) +endif() + +if("SPIF" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SPIF) +endif() + + +target_include_directories(mbed-os-storage-blockdevice + INTERFACE + . + ./include + ./include/blockdevice ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-blockdevice + INTERFACE source/BufferedBlockDevice.cpp source/ChainingBlockDevice.cpp source/ExhaustibleBlockDevice.cpp diff --git a/storage/blockdevice/COMPONENT_DATAFLASH/CMakeLists.txt b/storage/blockdevice/COMPONENT_DATAFLASH/CMakeLists.txt index e9c2978..2d6b44c 100644 --- a/storage/blockdevice/COMPONENT_DATAFLASH/CMakeLists.txt +++ b/storage/blockdevice/COMPONENT_DATAFLASH/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-dataflash + INTERFACE source/DataFlashBlockDevice.cpp ) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-storage-dataflash + INTERFACE include include/DataFlash ) diff --git a/storage/blockdevice/COMPONENT_FLASHIAP/CMakeLists.txt b/storage/blockdevice/COMPONENT_FLASHIAP/CMakeLists.txt index ab86ba2..742c9f4 100644 --- a/storage/blockdevice/COMPONENT_FLASHIAP/CMakeLists.txt +++ b/storage/blockdevice/COMPONENT_FLASHIAP/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-storage-flashiap + INTERFACE include include/FlashIAP ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-flashiap + INTERFACE source/FlashIAPBlockDevice.cpp ) diff --git a/storage/blockdevice/COMPONENT_I2CEE/CMakeLists.txt b/storage/blockdevice/COMPONENT_I2CEE/CMakeLists.txt index 14cf2cd..34ec132 100644 --- a/storage/blockdevice/COMPONENT_I2CEE/CMakeLists.txt +++ b/storage/blockdevice/COMPONENT_I2CEE/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-i2cee + INTERFACE source/I2CEEBlockDevice.cpp ) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-storage-i2cee + INTERFACE include include/I2CEE ) diff --git a/storage/blockdevice/COMPONENT_QSPIF/CMakeLists.txt b/storage/blockdevice/COMPONENT_QSPIF/CMakeLists.txt index 474b0a8..9f37249 100644 --- a/storage/blockdevice/COMPONENT_QSPIF/CMakeLists.txt +++ b/storage/blockdevice/COMPONENT_QSPIF/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-storage-qspif + INTERFACE include include/QSPIF ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-qspif + INTERFACE source/QSPIFBlockDevice.cpp ) diff --git a/storage/blockdevice/COMPONENT_SD/CMakeLists.txt b/storage/blockdevice/COMPONENT_SD/CMakeLists.txt index f4b7151..2299877 100644 --- a/storage/blockdevice/COMPONENT_SD/CMakeLists.txt +++ b/storage/blockdevice/COMPONENT_SD/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-sd + INTERFACE source/SDBlockDevice.cpp ) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-storage-sd + INTERFACE include include/SD ) diff --git a/storage/blockdevice/COMPONENT_SPIF/CMakeLists.txt b/storage/blockdevice/COMPONENT_SPIF/CMakeLists.txt index a664270..4b68c93 100644 --- a/storage/blockdevice/COMPONENT_SPIF/CMakeLists.txt +++ b/storage/blockdevice/COMPONENT_SPIF/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-spif + INTERFACE source/SPIFBlockDevice.cpp ) -target_include_directories(mbed-os - PUBLIC +target_include_directories(mbed-os-storage-spif + INTERFACE include include/SPIF ) diff --git a/storage/filesystem/CMakeLists.txt b/storage/filesystem/CMakeLists.txt index c9f5480..9d52d09 100644 --- a/storage/filesystem/CMakeLists.txt +++ b/storage/filesystem/CMakeLists.txt @@ -5,15 +5,15 @@ add_subdirectory(littlefs) add_subdirectory(littlefsv2) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/filesystem +target_include_directories(mbed-os-storage-filesystem + INTERFACE + . + ./include + ./include/filesystem ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-filesystem + INTERFACE source/Dir.cpp source/File.cpp source/FileSystem.cpp diff --git a/storage/filesystem/fat/CMakeLists.txt b/storage/filesystem/fat/CMakeLists.txt index e8380ca..f7b26fa 100644 --- a/storage/filesystem/fat/CMakeLists.txt +++ b/storage/filesystem/fat/CMakeLists.txt @@ -1,16 +1,16 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/fat - ${CMAKE_CURRENT_SOURCE_DIR}/ChaN +target_include_directories(mbed-os-storage-fat + INTERFACE + . + ./include + ./include/fat + ./ChaN ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-fat + INTERFACE source/FATFileSystem.cpp ChaN/ff.cpp diff --git a/storage/filesystem/littlefs/CMakeLists.txt b/storage/filesystem/littlefs/CMakeLists.txt index 34fefd4..9461cd1 100644 --- a/storage/filesystem/littlefs/CMakeLists.txt +++ b/storage/filesystem/littlefs/CMakeLists.txt @@ -1,18 +1,24 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/littlefs - ${CMAKE_CURRENT_SOURCE_DIR}/littlefs +target_include_directories(mbed-os-storage-littlefs + INTERFACE + . + ./include + ./include/littlefs + ./littlefs ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-littlefs + INTERFACE source/LittleFileSystem.cpp littlefs/lfs.c littlefs/lfs_util.c ) + +target_link_libraries(mbed-os-storage-littlefs + INTERFACE + mbed-os-storage-blockdevice + mbed-os-storage-filesystem +) diff --git a/storage/filesystem/littlefsv2/CMakeLists.txt b/storage/filesystem/littlefsv2/CMakeLists.txt index 5d186c6..b582cd0 100644 --- a/storage/filesystem/littlefsv2/CMakeLists.txt +++ b/storage/filesystem/littlefsv2/CMakeLists.txt @@ -1,18 +1,24 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/littlefsv2 - ${CMAKE_CURRENT_SOURCE_DIR}/littlefs +target_include_directories(mbed-os-storage-littlefs-v2 + INTERFACE + . + ./include + ./include/littlefsv2 + ./littlefs ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-littlefs-v2 + INTERFACE source/LittleFileSystem2.cpp littlefs/lfs2.c littlefs/lfs2_util.c ) + +target_link_libraries(mbed-os-storage-littlefs-v2 + INTERFACE + mbed-os-storage-blockdevice + mbed-os-storage-filesystem +) diff --git a/storage/kvstore/CMakeLists.txt b/storage/kvstore/CMakeLists.txt index 10ac9f2..ff229e3 100644 --- a/storage/kvstore/CMakeLists.txt +++ b/storage/kvstore/CMakeLists.txt @@ -5,17 +5,28 @@ add_subdirectory(kv_config) add_subdirectory(securestore) -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/kvstore +target_include_directories(mbed-os-storage-kvstore + INTERFACE + . + ./include + ./include/kvstore ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-kvstore + INTERFACE source/FileSystemStore.cpp source/KVMap.cpp source/TDBStore.cpp source/kvstore_global_api.cpp ) + +target_link_libraries(mbed-os-storage-kvstore + INTERFACE + mbed-os-device_key + mbed-os-storage-blockdevice + mbed-os-storage-filesystem + mbed-os-storage-fat + mbed-os-storage-littlefs + mbed-os-storage-flashiap + mbed-os-storage-sd +) diff --git a/storage/kvstore/direct_access_devicekey/CMakeLists.txt b/storage/kvstore/direct_access_devicekey/CMakeLists.txt index 267f217..4a67900 100644 --- a/storage/kvstore/direct_access_devicekey/CMakeLists.txt +++ b/storage/kvstore/direct_access_devicekey/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/direct_access_devicekey +target_include_directories(mbed-os-storage-kvstore + INTERFACE + . + ./include + ./include/direct_access_devicekey ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-kvstore + INTERFACE source/DirectAccessDevicekey.cpp ) diff --git a/storage/kvstore/kv_config/CMakeLists.txt b/storage/kvstore/kv_config/CMakeLists.txt index fd1e6dc..7ed0bd0 100644 --- a/storage/kvstore/kv_config/CMakeLists.txt +++ b/storage/kvstore/kv_config/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/kv_config +target_include_directories(mbed-os-storage-kvstore + INTERFACE + . + ./include + ./include/kv_config ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-kvstore + INTERFACE source/kv_config.cpp ) diff --git a/storage/kvstore/securestore/CMakeLists.txt b/storage/kvstore/securestore/CMakeLists.txt index 81993a8..0ab7d5b 100644 --- a/storage/kvstore/securestore/CMakeLists.txt +++ b/storage/kvstore/securestore/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-os - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/securestore +target_include_directories(mbed-os-storage-kvstore + INTERFACE + . + ./include + ./include/securestore ) -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage-kvstore + INTERFACE source/SecureStore.cpp ) diff --git a/storage/platform/CMakeLists.txt b/storage/platform/CMakeLists.txt index 96af304..77c5cd1 100644 --- a/storage/platform/CMakeLists.txt +++ b/storage/platform/CMakeLists.txt @@ -1,7 +1,39 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_sources(mbed-os - PRIVATE +target_sources(mbed-os-storage + INTERFACE source/PlatformStorage.cpp ) + +list(APPEND mbed-os-storage-libs + mbed-os-storage-blockdevice + mbed-os-storage-filesystem + mbed-os-storage-fat + mbed-os-storage-littlefs +) + +if("DATAFLASH" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-os-storage-libs mbed-os-storage-dataflash) +endif() + +if("FLASHIAP" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-os-storage-libs mbed-os-storage-flashiap) +endif() + +if("QSPIF" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-os-storage-libs mbed-os-storage-qspif) +endif() + +if("SD" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-os-storage-libs mbed-os-storage-sd) +endif() + +if("SPIF" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-os-storage-libs mbed-os-storage-spif) +endif() + +target_link_libraries(mbed-os-storage + INTERFACE + ${mbed-os-storage-libs} +) diff --git a/targets/TARGET_STM/USBPhyHw.h b/targets/TARGET_STM/USBPhyHw.h index 9424236..843d901 100644 --- a/targets/TARGET_STM/USBPhyHw.h +++ b/targets/TARGET_STM/USBPhyHw.h @@ -28,6 +28,7 @@ #include "platform/mbed_power_mgmt.h" #include "USBPhy.h" #include "PeripheralPins.h" +#include "string.h" #if !defined(MBED_CONF_TARGET_USB_SPEED) diff --git a/tools/cmake/README.md b/tools/cmake/README.md index db8b753..893319d 100644 --- a/tools/cmake/README.md +++ b/tools/cmake/README.md @@ -4,9 +4,9 @@ This is still at the experimental stage and still in development. It does not yet completely replace our current build tools. If you find a bug, please report it or raise a pull request as contributions are welcome! -Mbed OS is built as collection of all libraries supported by a given Mbed target. Application project executables can be linked with the monolithic `mbed-os` library to build Mbed applications. +Mbed OS is built as collection of all core libraries. Application project executables can be linked with the `mbed-os` library (which includes the core libraries of Mbed OS) and optional `mbed-os-` prefixed libraries depending on the additional features required by the projects and supported by the Mbed target. -We are currently working to break down the `mbed-os` library into several individual libraries that applications can selectively choose to include depending on their needs. +The list of optional libraries for each component can be seen in the CMake input source file at the root of each component directory. The following features are not yet supported and will be progressively added: * Application profile selection (`bare metal`)