Skip to content

Commit d5fb525

Browse files
HoZHelerwango
authored andcommitted
lib: Add dedicated CMakeLists.txt for STM32WB and STM32WBA
Add dedicated CMakeLists.txt for STM32WB and STM32WBA to have consistency with STM32WB0 approach. Signed-off-by: Ali Hozhabri <[email protected]>
1 parent 9681c01 commit d5fb525

File tree

3 files changed

+69
-67
lines changed

3 files changed

+69
-67
lines changed

lib/CMakeLists.txt

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,72 +5,7 @@
55
# SPDX-License-Identifier: Apache-2.0
66

77
if(CONFIG_HAS_STM32LIB)
8-
if(CONFIG_BT_STM32_IPM)
9-
zephyr_include_directories(stm32wb/hci)
10-
11-
zephyr_sources(stm32wb/hci/hw_ipcc.c)
12-
zephyr_sources(stm32wb/hci/shci.c)
13-
zephyr_sources(stm32wb/hci/shci_tl.c)
14-
zephyr_sources(stm32wb/hci/shci_tl_if.c)
15-
zephyr_sources(stm32wb/hci/stm_list.c)
16-
zephyr_sources(stm32wb/hci/tl_mbox.c)
17-
18-
endif()
19-
20-
if(CONFIG_BT_STM32WBA)
21-
22-
if(DEFINED CONFIG_BOARD_NUCLEO_WBA52CG)
23-
message(FATAL_ERROR "BLE library is not compatible with nucleo_wba52cg")
24-
endif()
25-
26-
zephyr_compile_definitions( -DBLE )
27-
28-
zephyr_include_directories(stm32wba/hci)
29-
zephyr_include_directories(stm32wba/hci/ll)
30-
31-
zephyr_sources(stm32wba/hci/ll_sys_cs.c)
32-
zephyr_sources(stm32wba/hci/ll_sys_intf.c)
33-
zephyr_sources(stm32wba/hci/ll_sys_dp_slp.c)
34-
zephyr_sources(stm32wba/hci/ll_sys_startup.c)
35-
zephyr_sources(stm32wba/hci/RTDebug.c)
36-
zephyr_sources(stm32wba/hci/hw_pka.c)
37-
zephyr_sources(stm32wba/hci/pka_p256.c)
38-
zephyr_sources(stm32wba/hci/bpka.c)
39-
zephyr_sources(stm32wba/hci/power_table.c)
40-
zephyr_sources(stm32wba/hci/scm.c)
41-
zephyr_sources(stm32wba/hci/log_module.c)
42-
zephyr_sources(stm32wba/hci/linklayer_plat.c)
43-
zephyr_sources(stm32wba/hci/ll_sys_if.c)
44-
if(CONFIG_FLASH)
45-
zephyr_sources(stm32wba/hci/flash_manager.c)
46-
zephyr_sources(stm32wba/hci/flash_driver.c)
47-
zephyr_sources(stm32wba/hci/stm_list.c)
48-
zephyr_sources(stm32wba/hci/rf_timing_synchro.c)
49-
endif()
50-
51-
set(STM32WBA_BLE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../zephyr/blobs/stm32wba/lib)
52-
set(STM32WBA_BLE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stm32wba/hci)
53-
54-
add_library(stm32wba_ble_lib STATIC IMPORTED GLOBAL)
55-
add_library(stm32wba_ll_lib STATIC IMPORTED GLOBAL)
56-
57-
add_dependencies(
58-
stm32wba_ble_lib
59-
stm32wba_ll_lib
60-
)
61-
set_target_properties(
62-
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llo.a
63-
)
64-
set_target_properties(
65-
stm32wba_ll_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/LinkLayer_BLE_Full_lib.a
66-
)
67-
68-
set_target_properties(stm32wba_ble_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_INCLUDE_DIR})
69-
set_target_properties(stm32wba_ll_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_INCLUDE_DIR})
70-
71-
target_link_libraries(app PUBLIC stm32wba_ble_lib)
72-
target_link_libraries(app PUBLIC stm32wba_ll_lib)
73-
74-
endif()
8+
add_subdirectory_ifdef(CONFIG_BT_STM32_IPM stm32wb)
9+
add_subdirectory_ifdef(CONFIG_BT_STM32WBA stm32wba)
7510
add_subdirectory_ifdef(CONFIG_BT_STM32WB0 stm32wb0)
7611
endif()

lib/stm32wb/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
zephyr_include_directories(hci)
6+
7+
zephyr_sources(hci/hw_ipcc.c)
8+
zephyr_sources(hci/shci.c)
9+
zephyr_sources(hci/shci_tl.c)
10+
zephyr_sources(hci/shci_tl_if.c)
11+
zephyr_sources(hci/stm_list.c)
12+
zephyr_sources(hci/tl_mbox.c)

lib/stm32wba/CMakeLists.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
if(DEFINED CONFIG_BOARD_NUCLEO_WBA52CG)
6+
message(FATAL_ERROR "BLE library is not compatible with nucleo_wba52cg")
7+
endif()
8+
9+
zephyr_compile_definitions( -DBLE )
10+
11+
zephyr_include_directories(hci)
12+
zephyr_include_directories(hci/ll)
13+
14+
zephyr_sources(hci/ll_sys_cs.c)
15+
zephyr_sources(hci/ll_sys_intf.c)
16+
zephyr_sources(hci/ll_sys_dp_slp.c)
17+
zephyr_sources(hci/ll_sys_startup.c)
18+
zephyr_sources(hci/RTDebug.c)
19+
zephyr_sources(hci/hw_pka.c)
20+
zephyr_sources(hci/pka_p256.c)
21+
zephyr_sources(hci/bpka.c)
22+
zephyr_sources(hci/power_table.c)
23+
zephyr_sources(hci/scm.c)
24+
zephyr_sources(hci/log_module.c)
25+
zephyr_sources(hci/linklayer_plat.c)
26+
zephyr_sources(hci/ll_sys_if.c)
27+
if(CONFIG_FLASH)
28+
zephyr_sources(hci/flash_manager.c)
29+
zephyr_sources(hci/flash_driver.c)
30+
zephyr_sources(hci/stm_list.c)
31+
zephyr_sources(hci/rf_timing_synchro.c)
32+
endif()
33+
34+
set(STM32WBA_BLE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../zephyr/blobs/stm32wba/lib)
35+
set(STM32WBA_BLE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hci)
36+
37+
add_library(stm32wba_ble_lib STATIC IMPORTED GLOBAL)
38+
add_library(stm32wba_ll_lib STATIC IMPORTED GLOBAL)
39+
40+
add_dependencies(
41+
stm32wba_ble_lib
42+
stm32wba_ll_lib
43+
)
44+
set_target_properties(
45+
stm32wba_ble_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/stm32wba_ble_stack_llo.a
46+
)
47+
set_target_properties(
48+
stm32wba_ll_lib PROPERTIES IMPORTED_LOCATION ${STM32WBA_BLE_LIB_DIR}/LinkLayer_BLE_Full_lib.a
49+
)
50+
51+
set_target_properties(stm32wba_ble_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_INCLUDE_DIR})
52+
set_target_properties(stm32wba_ll_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${STM32WBA_BLE_INCLUDE_DIR})
53+
54+
target_link_libraries(app PUBLIC stm32wba_ble_lib)
55+
target_link_libraries(app PUBLIC stm32wba_ll_lib)

0 commit comments

Comments
 (0)