CMake ble: remove component add function, use regular variable

use MBED_<library>_EXTRA_LIBRARIES variables we provide
pull/14427/head
Martin Kojtal 2021-03-04 16:55:00 +00:00
parent 4e977fc5a8
commit db35bbdc43
20 changed files with 28 additions and 62 deletions

View File

@ -7,3 +7,5 @@ target_sources(mbed-ble-cyw43xxx-43012
INTERFACE
w_bt_firmware_controller.c
)
target_link_libraries(mbed-ble-cyw43xxx-43012 INTERFACE mbed-ble-cyw43xxx)

View File

@ -7,3 +7,5 @@ target_sources(mbed-ble-cyw43xxx-4348
INTERFACE
w_bt_firmware_controller.c
)
target_link_libraries(mbed-ble-cyw43xxx-4348 INTERFACE mbed-ble-cyw43xxx)

View File

@ -7,3 +7,5 @@ target_sources(mbed-ble-cyw43xxx-4343w
INTERFACE
w_bt_firmware_controller.c
)
target_link_libraries(mbed-ble-cyw43xxx-4343w INTERFACE mbed-ble-cyw43xxx)

View File

@ -1,9 +1,11 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
add_library(mbed-ble-cyw9p62s1_43012evb_01 INTERFACE)
add_library(mbed-ble-cyw9p62s1_43012evb-01 INTERFACE)
target_sources(mbed-ble-cyw9p62s1_43012evb_01
target_sources(mbed-ble-cyw9p62s1_43012evb-01
INTERFACE
w_bt_firmware_controller.c
)
target_link_libraries(mbed-ble-cyw9p62s1_43012evb-01 INTERFACE mbed-ble-cyw43xxx)

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_subdirectory(TARGET_Apollo3 EXCLUDE_FROM_ALL)
add_library(mbed-ambiq-micro INTERFACE)
@ -28,4 +26,5 @@ target_sources(mbed-ambiq-micro
)
target_link_libraries(mbed-ambiq-micro INTERFACE mbed-cmsis-cortex-m)
mbed_add_component_libraries(mbed-ble mbed-ble-ambiq-micro mbed-ble-apollo3)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-ambiq-micro mbed-ble-apollo3 CACHE INTERNAL "")

View File

@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-cy8ckit064b0s2-4343w-bsp-design-modus INTERFACE)
target_include_directories(mbed-cy8ckit064b0s2-4343w-bsp-design-modus
@ -90,5 +89,5 @@ mbed_post_build_psoc6_sign_image(
"${MBED_PATH}/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/device/COMPONENT_CM4/hex/psoc6_02_cm0p_secure.hex"
)
mbed_add_component_libraries(mbed-ble mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6 CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-cy8ckit-062s2-43012-bsp-design-modus INTERFACE)
target_include_directories(mbed-cy8ckit-062s2-43012-bsp-design-modus
INTERFACE
@ -78,4 +76,4 @@ target_compile_definitions(mbed-cy8ckit-062s2-43012
"CYBSP_WIFI_CAPABLE"
)
mbed_add_component_libraries(mbed-ble mbed-ble-cyw43xxx-43012 mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-cyw43xxx-43012 mbed-ble-cyw43xxx-psoc6 CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-cy8ckit-062-wifi-bt-bsp-design-modus INTERFACE)
target_include_directories(mbed-cy8ckit-062-wifi-bt-bsp-design-modus
INTERFACE
@ -80,4 +78,4 @@ target_compile_definitions(mbed-cy8ckit-062-wifi-bt
"CYBSP_WIFI_CAPABLE"
)
mbed_add_component_libraries(mbed-ble mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx-psoc6 CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-cy8cproto-062s3-4343w-bsp-design-modus INTERFACE)
target_include_directories(mbed-cy8cproto-062s3-4343w-bsp-design-modus
INTERFACE
@ -79,5 +77,5 @@ target_compile_definitions(mbed-cy8cproto-062s3-4343w
"CYBSP_WIFI_CAPABLE"
)
mbed_add_component_libraries(mbed-ble mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx-psoc6 CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-cy8cproto-062-4343w-bsp-design-modus INTERFACE)
target_include_directories(mbed-cy8cproto-062-4343w-bsp-design-modus
INTERFACE
@ -79,4 +77,4 @@ target_compile_definitions(mbed-cy8cproto-062-4343w
"CYBSP_WIFI_CAPABLE"
)
mbed_add_component_libraries(mbed-ble mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx-psoc6 CACHE INTERNAL "")

View File

@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-cysbsyskit-01-bsp-design-modus INTERFACE)
target_include_directories(mbed-cysbsyskit-01-bsp-design-modus
@ -61,4 +60,4 @@ target_compile_definitions(mbed-cysbsyskit-01
)
mbed_post_build_psoc6_merge_hex("CYSBSYSKIT_01")
mbed_add_component_libraries(mbed-ble mbed-ble-cyw43xxx-43012 mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-cyw43xxx-43012 mbed-ble-cyw43xxx-psoc6 CACHE INTERNAL "")

View File

@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-cytfm-064b0s2-4343w-bsp-design-modus INTERFACE)
target_include_directories(mbed-cytfm-064b0s2-4343w-bsp-design-modus
@ -83,4 +82,4 @@ mbed_post_build_psoc6_sign_image(
${MBED_PATH}/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/COMPONENT_TFM_S_FW/tfm_s.hex
)
mbed_add_component_libraries(mbed-ble mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-cyw43xxx-4343w mbed-ble-cyw43xxx-psoc6 CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-cyw9p62s1-43012evb-01-bsp-design-modus INTERFACE)
target_include_directories(mbed-cyw9p62s1-43012evb-01-bsp-design-modus
INTERFACE
@ -82,4 +80,4 @@ target_compile_definitions(mbed-cyw9p62s1-43012evb-01
"CYBSP_WIFI_CAPABLE"
)
mbed_add_component_libraries(mbed-ble mbed-ble-cyw43xxx-43438 mbed-ble-cyw43xxx mbed-ble-cyw43xxx-psoc6)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-cyw43xxx-43438 mbed-ble-cyw43xxx-psoc6 CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-nrf52-dk INTERFACE)
add_library(mbed-sdt52832b INTERFACE)
@ -49,4 +47,4 @@ target_link_libraries(mbed-mcu-nrf52832 INTERFACE mbed-nrf52 mbed-sdk-15-0)
target_link_libraries(mbed-nrf52-dk INTERFACE mbed-mcu-nrf52832)
target_link_libraries(mbed-sdt52832b INTERFACE mbed-mcu-nrf52832)
mbed_add_component_libraries(mbed-ble mbed-ble-nrf5x-cordio mbed-ble-cordio_ll)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-nrf5x-cordio mbed-ble-cordio_ll CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-arduino-nano33ble INTERFACE)
add_library(mbed-ep-agora INTERFACE)
add_library(mbed-ep-atlas INTERFACE)
@ -75,5 +73,5 @@ target_link_libraries(mbed-ep-agora INTERFACE mbed-mcu-nrf52840)
target_link_libraries(mbed-ep-atlas INTERFACE mbed-mcu-nrf52840)
target_link_libraries(mbed-nrf52840-dk INTERFACE mbed-mcu-nrf52840)
mbed_add_component_libraries(mbed-ble mbed-ble-nrf5x-cordio mbed-ble-cordio_ll)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-nrf5x-cordio mbed-ble-cordio_ll CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-disco-l475vg-iot01a INTERFACE)
target_sources(mbed-disco-l475vg-iot01a
@ -17,4 +15,4 @@ target_include_directories(mbed-disco-l475vg-iot01a
target_link_libraries(mbed-disco-l475vg-iot01a INTERFACE mbed-stm32l475xg)
mbed_add_component_libraries(mbed-ble mbed-ble-bluenrg_ms)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-bluenrg_ms CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-b-l4s5i-iot01a INTERFACE)
target_sources(mbed-b-l4s5i-iot01a
@ -17,4 +15,5 @@ target_include_directories(mbed-b-l4s5i-iot01a
target_link_libraries(mbed-b-l4s5i-iot01a INTERFACE mbed-stm32l4s5xi)
mbed_add_component_libraries(mbed-ble mbed-ble-bluenrg_ms)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-bluenrg_ms CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_library(mbed-disco-l562qe INTERFACE)
target_sources(mbed-disco-l562qe
@ -17,4 +15,4 @@ target_include_directories(mbed-disco-l562qe
target_link_libraries(mbed-disco-l562qe INTERFACE mbed-stm32l562xe)
mbed_add_component_libraries(mbed-ble mbed-ble-bluenrg_ms)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-bluenrg_ms CACHE INTERNAL "")

View File

@ -1,8 +1,6 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/components.cmake)
add_subdirectory(TARGET_STM32WB50xx EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32WB55xx EXCLUDE_FROM_ALL)
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
@ -26,4 +24,5 @@ target_include_directories(mbed-stm32wb
)
target_link_libraries(mbed-stm32wb INTERFACE mbed-stm mbed-stm32wbcube-fw)
mbed_add_component_libraries(mbed-ble mbed-ble-stm32wb)
set(MBED_BLE_EXTRA_LIBRARIES ${MBED_BLE_EXTRA_LIBRARIES} mbed-ble-stm32wb CACHE INTERNAL "")

View File

@ -1,18 +0,0 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
list(APPEND MBED_COMPONENTS_LIST mbed-ble mbed-cellular mbed-nfc mbed-nanostack mbed-netsockets mbed-wifi)
# Add libraries to specified components
# This can be used to link additional libraries that are required
# ARGN is a list of libraries to add to mbed-<component>
function(mbed_add_component_libraries component)
# we use global symbols, using upper case
string(TOUPPER ${component} component_upper)
if(component IN_LIST MBED_COMPONENTS_LIST)
set(${component_upper}_EXTRA_LIBRARIES "${${component}_EXTRA_LIBRARIES};{ARGN}" CACHE INTERNAL "")
else()
message("Mbed OS components are: ${MBED_COMPONENTS_LIST}")
message(FATAL_ERROR "Component: ${component} not found")
endif()
endfunction()