Skip to content

Commit f5417f7

Browse files
author
Jamie Smith
authored
Fix build for devices with MESH as the default network type (#361)
1 parent 44ce176 commit f5417f7

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

connectivity/drivers/802.15.4_RF/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ macro(create_mbed_802_15_4_target)
99
# Nanostack drivers always require Mbed RTOS
1010
target_link_libraries(mbed-802.15.4-rf PUBLIC mbed-core-flags mbed-rtos-flags)
1111

12+
# For NanostackRfPhy.h
13+
target_link_libraries(mbed-802.15.4-rf PUBLIC mbed-nanostack)
14+
1215
target_link_libraries(mbed-nanostack
1316
INTERFACE
1417
mbed-802.15.4-rf

connectivity/nanostack/mbed-mesh-api/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ target_link_libraries(mbed-nanostack-mbed_mesh_api
3434
PUBLIC
3535
mbed-nanostack-hal_mbed_cmsis_rtos
3636
mbed-nanostack-sal_stack
37+
mbed-nanostack
3738
mbed-netsocket-api
3839
mbed-core-flags
3940
PRIVATE
4041
mbed-rtos-flags
4142
)
43+
44+
# Since there are a lot of circular references between this library and mbed-netsocket-api,
45+
# we have to have CMake repeat the libraries on the link line multiple times.
46+
set_property(TARGET mbed-nanostack-mbed_mesh_api PROPERTY LINK_INTERFACE_MULTIPLICITY 3)

connectivity/netsocket/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ if("MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE=CELLULAR" IN_LIST MBED_CONFI
6969
target_link_libraries(mbed-netsocket-api PUBLIC mbed-cellular)
7070
endif()
7171

72+
# Similarly if mesh networking is used bring in that library
73+
if("MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE=MESH" IN_LIST MBED_CONFIG_DEFINITIONS)
74+
target_link_libraries(mbed-netsocket-api PUBLIC mbed-nanostack-mbed_mesh_api)
75+
endif()
76+
77+
7278
if("DEVICE_EMAC=1" IN_LIST MBED_TARGET_DEFINITIONS)
7379
target_link_libraries(mbed-netsocket-api
7480
INTERFACE

0 commit comments

Comments
 (0)