diff --git a/connectivity/drivers/802.15.4_RF/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/CMakeLists.txt index 7cd94d0f7af..3108799bec1 100644 --- a/connectivity/drivers/802.15.4_RF/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/CMakeLists.txt @@ -9,6 +9,9 @@ macro(create_mbed_802_15_4_target) # Nanostack drivers always require Mbed RTOS target_link_libraries(mbed-802.15.4-rf PUBLIC mbed-core-flags mbed-rtos-flags) + # For NanostackRfPhy.h + target_link_libraries(mbed-802.15.4-rf PUBLIC mbed-nanostack) + target_link_libraries(mbed-nanostack INTERFACE mbed-802.15.4-rf diff --git a/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt b/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt index 42fbaa9dd6e..9ea34c10c11 100644 --- a/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt +++ b/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt @@ -34,8 +34,13 @@ target_link_libraries(mbed-nanostack-mbed_mesh_api PUBLIC mbed-nanostack-hal_mbed_cmsis_rtos mbed-nanostack-sal_stack + mbed-nanostack mbed-netsocket-api mbed-core-flags PRIVATE mbed-rtos-flags ) + +# Since there are a lot of circular references between this library and mbed-netsocket-api, +# we have to have CMake repeat the libraries on the link line multiple times. +set_property(TARGET mbed-nanostack-mbed_mesh_api PROPERTY LINK_INTERFACE_MULTIPLICITY 3) \ No newline at end of file diff --git a/connectivity/netsocket/CMakeLists.txt b/connectivity/netsocket/CMakeLists.txt index b0623b4fec5..271b0f7854e 100644 --- a/connectivity/netsocket/CMakeLists.txt +++ b/connectivity/netsocket/CMakeLists.txt @@ -69,6 +69,12 @@ if("MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE=CELLULAR" IN_LIST MBED_CONFI target_link_libraries(mbed-netsocket-api PUBLIC mbed-cellular) endif() +# Similarly if mesh networking is used bring in that library +if("MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE=MESH" IN_LIST MBED_CONFIG_DEFINITIONS) + target_link_libraries(mbed-netsocket-api PUBLIC mbed-nanostack-mbed_mesh_api) +endif() + + if("DEVICE_EMAC=1" IN_LIST MBED_TARGET_DEFINITIONS) target_link_libraries(mbed-netsocket-api INTERFACE