Skip to content

Commit c7c2580

Browse files
committed
CMake: Fix mbed-802.15.4-rf driver
mbed-nanostack should depend on mbed-802.15.4-rf to avoid a linker error with an undefined reference to `NanostackRfPhy::get_default_instance()`. The error occurs when `device_has: 802_15_4_PHY` is defined and the consumer depends on mbed-nanostack in their CMakeLists.txt. Previously we linked mbed-nanostack to mbed-802.15.4-rf, so mbed-802.15.4-rf's usage requirements weren't forwarded to consumers who depended on mbed-nanostack. With the previous configuration, the consumer would have to depend on mbed-802.15.4-rf directly to avoid an issue. This seems like a layering violation: it appears that mbed-nanostack is "the API" and mbed-802.15.4-rf is one of several possible implementations which are selected based on configuration macros. This commit changes the flow of dependencies so that mbed-nanostack ends up with the correct symbol definitions.
1 parent f4f8d8f commit c7c2580

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

connectivity/drivers/802.15.4_RF/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ endif()
1212

1313
add_subdirectory(atmel-rf-driver)
1414

15-
target_link_libraries(mbed-802.15.4-rf
15+
target_link_libraries(mbed-nanostack
1616
INTERFACE
17-
mbed-nanostack
17+
mbed-802.15.4-rf
1818
)

0 commit comments

Comments
 (0)