diff --git a/examples/apps/cli/CMakeLists.txt b/examples/apps/cli/CMakeLists.txt index d4bd9f377..9f756883f 100644 --- a/examples/apps/cli/CMakeLists.txt +++ b/examples/apps/cli/CMakeLists.txt @@ -48,7 +48,6 @@ target_link_libraries(ot-cli-ftd openthread-cli-ftd ${OT_PLATFORM_LIB} openthread-ftd - openthread-platform-utils ${OT_PLATFORM_LIB} mbedcrypto ) @@ -57,7 +56,6 @@ target_link_libraries(ot-cli-mtd openthread-cli-mtd ${OT_PLATFORM_LIB} openthread-mtd - openthread-platform-utils ${OT_PLATFORM_LIB} mbedcrypto ) diff --git a/examples/apps/ncp/CMakeLists.txt b/examples/apps/ncp/CMakeLists.txt index b966d0b20..5ac8658ac 100644 --- a/examples/apps/ncp/CMakeLists.txt +++ b/examples/apps/ncp/CMakeLists.txt @@ -53,7 +53,6 @@ target_link_libraries(ot-ncp-ftd openthread-ncp-ftd ${OT_PLATFORM_LIB} openthread-ftd - openthread-platform-utils ${OT_PLATFORM_LIB} mbedcrypto ) @@ -62,7 +61,6 @@ target_link_libraries(ot-ncp-mtd openthread-ncp-mtd ${OT_PLATFORM_LIB} openthread-mtd - openthread-platform-utils ${OT_PLATFORM_LIB} mbedcrypto ) @@ -71,6 +69,5 @@ target_link_libraries(ot-rcp openthread-rcp ${OT_PLATFORM_LIB} openthread-radio - openthread-platform-utils ${OT_PLATFORM_LIB} ) diff --git a/examples/platforms/cc2538/CMakeLists.txt b/examples/platforms/cc2538/CMakeLists.txt index e1db93fbc..3a59d40c4 100644 --- a/examples/platforms/cc2538/CMakeLists.txt +++ b/examples/platforms/cc2538/CMakeLists.txt @@ -37,8 +37,11 @@ add_library(openthread-cc2538 system.c logging.c uart.c + $ ) +target_link_libraries(openthread-cc2538 PRIVATE openthread-platform-utils) + target_include_directories(openthread-cc2538 PRIVATE ${OT_PUBLIC_INCLUDES} ${OT_PRIVATE_INCLUDES} diff --git a/examples/platforms/posix/CMakeLists.txt b/examples/platforms/posix/CMakeLists.txt index 3ac789a1c..a21d83b8f 100644 --- a/examples/platforms/posix/CMakeLists.txt +++ b/examples/platforms/posix/CMakeLists.txt @@ -41,12 +41,15 @@ add_library(openthread-posix uart-posix.c sim/alarm-sim.c sim/platform-sim.c + $ ) if(LIBRT) target_link_libraries(openthread-posix PRIVATE ${LIBRT}) endif() +target_link_libraries(openthread-posix PRIVATE openthread-platform-utils) + target_include_directories(openthread-posix PRIVATE ${OT_PUBLIC_INCLUDES} ${OT_PRIVATE_INCLUDES} diff --git a/examples/platforms/utils/CMakeLists.txt b/examples/platforms/utils/CMakeLists.txt index b99dac922..2adb8525c 100644 --- a/examples/platforms/utils/CMakeLists.txt +++ b/examples/platforms/utils/CMakeLists.txt @@ -26,7 +26,7 @@ # POSSIBILITY OF SUCH DAMAGE. # -add_library(openthread-platform-utils +add_library(openthread-platform-utils OBJECT debug_uart.c logging_rtt.c mac_frame.cpp @@ -47,3 +47,7 @@ target_include_directories(openthread-platform-utils PRIVATE ${OT_ROOT_DIR}/src/core ${OT_ROOT_DIR}/third_party/jlink/SEGGER_RTT_V640/RTT ) + +# Provide a static library implementation of platform-utils for non-cmake platforms +add_library(openthread-platform-utils-static $) +target_link_libraries(openthread-platform-utils-static PUBLIC openthread-platform-utils)