diff --git a/CMakeLists.txt b/CMakeLists.txt index 642332f5e..7a31b16d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ set(OT_EXTERNAL_MBEDTLS "" CACHE STRING "Specify external mbedtls library") option(OT_MBEDTLS_THREADING "enable mbedtls threading" OFF) add_library(ot-config INTERFACE) +add_library(ot-config-ftd INTERFACE) +add_library(ot-config-mtd INTERFACE) +add_library(ot-config-radio INTERFACE) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD 11) set(CMAKE_C_STANDARD 99) diff --git a/examples/apps/cli/ftd.cmake b/examples/apps/cli/ftd.cmake index f5a2870f8..b8aac6e56 100644 --- a/examples/apps/cli/ftd.cmake +++ b/examples/apps/cli/ftd.cmake @@ -44,6 +44,7 @@ target_link_libraries(ot-cli-ftd PRIVATE ${OT_PLATFORM_LIB_FTD} openthread-cli-ftd ${OT_MBEDTLS} + ot-config-ftd ot-config ) diff --git a/examples/apps/cli/mtd.cmake b/examples/apps/cli/mtd.cmake index 7b71883bb..df1729673 100644 --- a/examples/apps/cli/mtd.cmake +++ b/examples/apps/cli/mtd.cmake @@ -44,6 +44,7 @@ target_link_libraries(ot-cli-mtd PRIVATE ${OT_PLATFORM_LIB_MTD} openthread-cli-mtd ${OT_MBEDTLS} + ot-config-mtd ot-config ) diff --git a/examples/apps/cli/radio.cmake b/examples/apps/cli/radio.cmake index 4302adca5..715c0f687 100644 --- a/examples/apps/cli/radio.cmake +++ b/examples/apps/cli/radio.cmake @@ -48,6 +48,7 @@ target_link_libraries(ot-cli-radio PRIVATE ${OT_PLATFORM_LIB_RCP} openthread-cli-radio ${OT_MBEDTLS_RCP} + ot-config-radio ot-config ) diff --git a/examples/apps/ncp/ftd.cmake b/examples/apps/ncp/ftd.cmake index c7d0bbf5d..353b21bac 100644 --- a/examples/apps/ncp/ftd.cmake +++ b/examples/apps/ncp/ftd.cmake @@ -44,6 +44,7 @@ target_link_libraries(ot-ncp-ftd PRIVATE ${OT_PLATFORM_LIB_FTD} openthread-ncp-ftd ${OT_MBEDTLS} + ot-config-ftd ot-config ) diff --git a/examples/apps/ncp/mtd.cmake b/examples/apps/ncp/mtd.cmake index 61380c3b5..6a548ee9a 100644 --- a/examples/apps/ncp/mtd.cmake +++ b/examples/apps/ncp/mtd.cmake @@ -44,6 +44,7 @@ target_link_libraries(ot-ncp-mtd PRIVATE ${OT_PLATFORM_LIB_MTD} openthread-ncp-mtd ${OT_MBEDTLS} + ot-config-mtd ot-config ) diff --git a/examples/apps/ncp/rcp.cmake b/examples/apps/ncp/rcp.cmake index 7ba3b9725..40334c339 100644 --- a/examples/apps/ncp/rcp.cmake +++ b/examples/apps/ncp/rcp.cmake @@ -43,6 +43,7 @@ target_link_libraries(ot-rcp PRIVATE openthread-radio ${OT_PLATFORM_LIB_RCP} openthread-rcp + ot-config-radio ot-config ) diff --git a/src/cli/ftd.cmake b/src/cli/ftd.cmake index a101da342..22f1e11f6 100644 --- a/src/cli/ftd.cmake +++ b/src/cli/ftd.cmake @@ -46,5 +46,6 @@ target_link_libraries(openthread-cli-ftd openthread-ftd PRIVATE ${OT_MBEDTLS} + ot-config-ftd ot-config ) diff --git a/src/cli/mtd.cmake b/src/cli/mtd.cmake index c8c42305d..3a875c39d 100644 --- a/src/cli/mtd.cmake +++ b/src/cli/mtd.cmake @@ -46,5 +46,6 @@ target_link_libraries(openthread-cli-mtd openthread-mtd PRIVATE ${OT_MBEDTLS} + ot-config-mtd ot-config ) diff --git a/src/cli/radio.cmake b/src/cli/radio.cmake index 3e7354aa6..6fa0b9144 100644 --- a/src/cli/radio.cmake +++ b/src/cli/radio.cmake @@ -55,5 +55,6 @@ target_link_libraries(openthread-cli-radio openthread-radio PRIVATE ${OT_MBEDTLS_RCP} + ot-config-radio ot-config ) diff --git a/src/core/ftd.cmake b/src/core/ftd.cmake index 8bf3e0e6a..928a2b4c3 100644 --- a/src/core/ftd.cmake +++ b/src/core/ftd.cmake @@ -43,6 +43,7 @@ target_sources(openthread-ftd PRIVATE ${COMMON_SOURCES}) target_link_libraries(openthread-ftd PRIVATE ${OT_MBEDTLS} + ot-config-ftd ot-config ) diff --git a/src/core/mtd.cmake b/src/core/mtd.cmake index feec81e41..9857a734b 100644 --- a/src/core/mtd.cmake +++ b/src/core/mtd.cmake @@ -43,6 +43,7 @@ target_sources(openthread-mtd PRIVATE ${COMMON_SOURCES}) target_link_libraries(openthread-mtd PRIVATE ${OT_MBEDTLS} + ot-config-mtd ot-config ) diff --git a/src/core/radio.cmake b/src/core/radio.cmake index f70a8dd36..95ae91533 100644 --- a/src/core/radio.cmake +++ b/src/core/radio.cmake @@ -54,5 +54,6 @@ endif() target_link_libraries(openthread-radio PRIVATE ${OT_MBEDTLS_RCP} + ot-config-radio ot-config ) diff --git a/src/core/radio_cli.cmake b/src/core/radio_cli.cmake index b4e26fe18..31e7b6dae 100644 --- a/src/core/radio_cli.cmake +++ b/src/core/radio_cli.cmake @@ -54,5 +54,6 @@ endif() target_link_libraries(openthread-radio-cli PRIVATE ${OT_MBEDTLS_RCP} + ot-config-radio ot-config ) diff --git a/src/lib/spinel/CMakeLists.txt b/src/lib/spinel/CMakeLists.txt index 85114f78f..5c01ec30c 100644 --- a/src/lib/spinel/CMakeLists.txt +++ b/src/lib/spinel/CMakeLists.txt @@ -67,5 +67,14 @@ target_include_directories(openthread-spinel-rcp PUBLIC ${OT_PUBLIC_INCLUDES} PR target_sources(openthread-spinel-ncp PRIVATE ${COMMON_SOURCES}) target_sources(openthread-spinel-rcp PRIVATE ${COMMON_SOURCES}) -target_link_libraries(openthread-spinel-ncp PRIVATE ot-config) -target_link_libraries(openthread-spinel-rcp PRIVATE ot-config) +target_link_libraries(openthread-spinel-ncp + PRIVATE + ot-config-ftd + ot-config +) + +target_link_libraries(openthread-spinel-rcp + PRIVATE + ot-config-radio + ot-config +) diff --git a/src/ncp/ftd.cmake b/src/ncp/ftd.cmake index 4ba31307d..43b5f4f80 100644 --- a/src/ncp/ftd.cmake +++ b/src/ncp/ftd.cmake @@ -49,5 +49,6 @@ target_link_libraries(openthread-ncp-ftd ${OT_MBEDTLS} openthread-hdlc openthread-spinel-ncp + ot-config-ftd ot-config ) diff --git a/src/ncp/mtd.cmake b/src/ncp/mtd.cmake index e1ceb6f8a..6d8de8e14 100644 --- a/src/ncp/mtd.cmake +++ b/src/ncp/mtd.cmake @@ -49,5 +49,6 @@ target_link_libraries(openthread-ncp-mtd ${OT_MBEDTLS} openthread-hdlc openthread-spinel-ncp + ot-config-mtd ot-config ) diff --git a/src/ncp/radio.cmake b/src/ncp/radio.cmake index 427e7b5da..3b3122f48 100644 --- a/src/ncp/radio.cmake +++ b/src/ncp/radio.cmake @@ -49,5 +49,6 @@ target_link_libraries(openthread-rcp PRIVATE openthread-hdlc openthread-spinel-rcp + ot-config-radio ot-config ) diff --git a/src/posix/cli.cmake b/src/posix/cli.cmake index e9b2e1033..4354374d2 100644 --- a/src/posix/cli.cmake +++ b/src/posix/cli.cmake @@ -53,6 +53,7 @@ target_link_libraries(ot-cli openthread-spinel-rcp ${OT_MBEDTLS} ${READLINE_LINK_LIBRARIES} + ot-config-ftd ot-config ) diff --git a/src/posix/daemon.cmake b/src/posix/daemon.cmake index 7116a4a2b..cf2c7b7d9 100644 --- a/src/posix/daemon.cmake +++ b/src/posix/daemon.cmake @@ -45,6 +45,7 @@ target_link_libraries(ot-daemon PRIVATE openthread-spinel-rcp ${OT_MBEDTLS} ot-posix-config + ot-config-ftd ot-config ) diff --git a/src/posix/platform/CMakeLists.txt b/src/posix/platform/CMakeLists.txt index 541dbb211..1f9081747 100644 --- a/src/posix/platform/CMakeLists.txt +++ b/src/posix/platform/CMakeLists.txt @@ -121,6 +121,7 @@ target_link_libraries(openthread-posix openthread-platform PRIVATE openthread-url + ot-config-ftd ot-config ot-posix-config util