From 378ad046c8967dd7d00a1ebc6c8f6e9ac5b93724 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 4 Aug 2021 14:22:54 -0700 Subject: [PATCH] drivers: bluetooth: build as static library Instead of putting object files inside libzephyr.a, simply build a separate static library as most other driver types are doing this already. Note that the include to subsys/bluetooth has been moved from under drivers/bluetooth to subsys/bluetooth, as it is actually the subsystem's job to make sure the include directories are correct. Signed-off-by: Daniel Leung --- drivers/bluetooth/CMakeLists.txt | 3 ++- drivers/bluetooth/hci/CMakeLists.txt | 16 ++++++++-------- subsys/bluetooth/CMakeLists.txt | 2 ++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/bluetooth/CMakeLists.txt b/drivers/bluetooth/CMakeLists.txt index c3c5ba1c0bd..14fa865f870 100644 --- a/drivers/bluetooth/CMakeLists.txt +++ b/drivers/bluetooth/CMakeLists.txt @@ -1,4 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_include_directories(${ZEPHYR_BASE}/subsys/bluetooth) +zephyr_library() +zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/bluetooth) add_subdirectory(hci) diff --git a/drivers/bluetooth/hci/CMakeLists.txt b/drivers/bluetooth/hci/CMakeLists.txt index ea87556d796..09775db855b 100644 --- a/drivers/bluetooth/hci/CMakeLists.txt +++ b/drivers/bluetooth/hci/CMakeLists.txt @@ -1,10 +1,10 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_sources_ifdef(CONFIG_BT_H4 h4.c) -zephyr_sources_ifdef(CONFIG_BT_H5 h5.c) -zephyr_sources_ifdef(CONFIG_BT_SPI spi.c) -zephyr_sources_ifdef(CONFIG_BT_RPMSG rpmsg.c) -zephyr_sources_ifdef(CONFIG_BT_RPMSG_NRF53 rpmsg_nrf53.c) -zephyr_sources_ifdef(CONFIG_BT_STM32_IPM ipm_stm32wb.c) -zephyr_sources_ifdef(CONFIG_BT_USERCHAN userchan.c) -zephyr_sources_ifdef(CONFIG_BT_ESP32 hci_esp32.c) +zephyr_library_sources_ifdef(CONFIG_BT_ESP32 hci_esp32.c) +zephyr_library_sources_ifdef(CONFIG_BT_H4 h4.c) +zephyr_library_sources_ifdef(CONFIG_BT_H5 h5.c) +zephyr_library_sources_ifdef(CONFIG_BT_RPMSG rpmsg.c) +zephyr_library_sources_ifdef(CONFIG_BT_RPMSG_NRF53 rpmsg_nrf53.c) +zephyr_library_sources_ifdef(CONFIG_BT_SPI spi.c) +zephyr_library_sources_ifdef(CONFIG_BT_STM32_IPM ipm_stm32wb.c) +zephyr_library_sources_ifdef(CONFIG_BT_USERCHAN userchan.c) diff --git a/subsys/bluetooth/CMakeLists.txt b/subsys/bluetooth/CMakeLists.txt index 9cc0d7a43d7..c020481f7a4 100644 --- a/subsys/bluetooth/CMakeLists.txt +++ b/subsys/bluetooth/CMakeLists.txt @@ -14,3 +14,5 @@ add_subdirectory_ifdef(CONFIG_BT_AUDIO audio) if(CONFIG_BT_CTLR AND CONFIG_BT_LL_SW_SPLIT) add_subdirectory(controller) endif() + +zephyr_include_directories(${ZEPHYR_BASE}/subsys/bluetooth)