From 88188c6fe109faa0191d703fdcc6392f6c9b7455 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Wed, 18 Oct 2023 10:02:57 +0800 Subject: [PATCH] add lib openthread-radio-spinel --- src/lib/spinel/CMakeLists.txt | 14 +++++++++++--- src/posix/cli.cmake | 1 + src/posix/daemon.cmake | 1 + src/posix/platform/CMakeLists.txt | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/lib/spinel/CMakeLists.txt b/src/lib/spinel/CMakeLists.txt index d36e1e2675f..e6cf16f58fd 100644 --- a/src/lib/spinel/CMakeLists.txt +++ b/src/lib/spinel/CMakeLists.txt @@ -26,6 +26,7 @@ # POSSIBILITY OF SUCH DAMAGE. # +add_library(openthread-radio-spinel) add_library(openthread-spinel-ncp) add_library(openthread-spinel-rcp) @@ -37,6 +38,10 @@ target_compile_definitions(openthread-spinel-rcp PRIVATE PUBLIC OPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE=0 ) +target_compile_options(openthread-radio-spinel PRIVATE + ${OT_CFLAGS} +) + target_compile_options(openthread-spinel-ncp PRIVATE ${OT_CFLAGS} ) @@ -57,14 +62,17 @@ set(COMMON_SOURCES spinel_encoder.cpp ) +target_include_directories(openthread-radio-spinel PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES}) target_include_directories(openthread-spinel-ncp PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES}) target_include_directories(openthread-spinel-rcp PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES}) +target_sources(openthread-radio-spinel PRIVATE radio_spinel.cpp) target_sources(openthread-spinel-ncp PRIVATE ${COMMON_SOURCES}) -target_sources(openthread-spinel-rcp +target_sources(openthread-spinel-rcp PRIVATE ${COMMON_SOURCES}) + +target_link_libraries(openthread-radio-spinel PRIVATE - ${COMMON_SOURCES} - radio_spinel.cpp + ot-config ) target_link_libraries(openthread-spinel-ncp diff --git a/src/posix/cli.cmake b/src/posix/cli.cmake index 4b7347b4039..a11ef0b8545 100644 --- a/src/posix/cli.cmake +++ b/src/posix/cli.cmake @@ -50,6 +50,7 @@ target_link_libraries(ot-cli PRIVATE openthread-posix openthread-cli-ftd openthread-hdlc + openthread-radio-spinel openthread-spinel-rcp ${OT_MBEDTLS} ${READLINE_LINK_LIBRARIES} diff --git a/src/posix/daemon.cmake b/src/posix/daemon.cmake index dd726df27b7..dd19a22806a 100644 --- a/src/posix/daemon.cmake +++ b/src/posix/daemon.cmake @@ -42,6 +42,7 @@ target_link_libraries(ot-daemon PRIVATE openthread-ftd openthread-posix openthread-hdlc + openthread-radio-spinel openthread-spinel-rcp ${OT_MBEDTLS} ot-posix-config diff --git a/src/posix/platform/CMakeLists.txt b/src/posix/platform/CMakeLists.txt index b367d8758d6..dfc62408eba 100644 --- a/src/posix/platform/CMakeLists.txt +++ b/src/posix/platform/CMakeLists.txt @@ -154,6 +154,7 @@ target_link_libraries(openthread-posix openthread-cli-ftd openthread-ftd openthread-hdlc + openthread-radio-spinel openthread-spinel-rcp openthread-url ot-config-ftd