mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 01:17:46 +00:00
[cmake] add ot-config (#5003)
This commit adds an interface target ot-config for collecting compile definitions.
This commit is contained in:
+11
-9
@@ -38,10 +38,12 @@ option(OT_BUILD_EXECUTABLES "Build executables" ON)
|
||||
option(OT_COVERAGE "enable coverage" OFF)
|
||||
set(OT_EXTERNAL_MBEDTLS "" CACHE STRING "Specify external mbedtls library")
|
||||
|
||||
add_library(ot-config INTERFACE)
|
||||
|
||||
include(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(OT_BIG_ENDIAN)
|
||||
if(OT_BIG_ENDIAN)
|
||||
list(APPEND OT_PRIVATE_DEFINES "BYTE_ORDER_BIG_ENDIAN=1")
|
||||
target_compile_definitions(ot-config INTERFACE "BYTE_ORDER_BIG_ENDIAN=1")
|
||||
endif()
|
||||
|
||||
include("${PROJECT_SOURCE_DIR}/etc/cmake/checks.cmake")
|
||||
@@ -55,7 +57,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
|
||||
endif()
|
||||
|
||||
if(OT_COVERAGE)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_ENABLE_COVERAGE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_ENABLE_COVERAGE=1")
|
||||
add_compile_options(-g -O0 --coverage)
|
||||
add_link_options(--coverage)
|
||||
endif()
|
||||
@@ -73,7 +75,7 @@ execute_process(
|
||||
)
|
||||
message(STATUS "Version: ${OT_VERSION}")
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES
|
||||
target_compile_definitions(ot-config INTERFACE
|
||||
"PACKAGE_NAME=\"OPENTHREAD\""
|
||||
"PACKAGE_VERSION=\"${OT_VERSION}\""
|
||||
)
|
||||
@@ -81,9 +83,9 @@ list(APPEND OT_PRIVATE_DEFINES
|
||||
set(OT_THREAD_VERSION "1.1" CACHE STRING "Thread version chosen by the user at configure time")
|
||||
set_property(CACHE OT_THREAD_VERSION PROPERTY STRINGS "1.1" "1.2")
|
||||
if(${OT_THREAD_VERSION} EQUAL "1.1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_1")
|
||||
elseif(${OT_THREAD_VERSION} EQUAL "1.2")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_2")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_2")
|
||||
else()
|
||||
message(FATAL_ERROR "Thread version unknown: ${OT_THREAD_VERSION}")
|
||||
endif()
|
||||
@@ -114,7 +116,7 @@ if(OT_LOG_OUTPUT)
|
||||
if(NOT OT_LOG_OUTPUT IN_LIST OT_LOG_OUTPUT_VALUES)
|
||||
message(FATAL_ERROR "Log output unknown: ${OT_LOG_OUTPUT}")
|
||||
endif()
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_${OT_LOG_OUTPUT}")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_${OT_LOG_OUTPUT}")
|
||||
message(STATUS "Log output: ${OT_LOG_OUTPUT}")
|
||||
endif()
|
||||
|
||||
@@ -139,11 +141,11 @@ elseif(NOT OT_PLATFORM MATCHES "none")
|
||||
endif()
|
||||
|
||||
if(OT_CONFIG)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"")
|
||||
message(STATUS "Project core config: \"${OT_CONFIG}\"")
|
||||
endif()
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES ${OT_PLATFORM_DEFINES})
|
||||
target_compile_definitions(ot-config INTERFACE ${OT_PLATFORM_DEFINES})
|
||||
|
||||
if(OT_PLATFORM STREQUAL "posix")
|
||||
if(OT_BUILD_EXECUTABLES)
|
||||
@@ -163,4 +165,4 @@ if(OT_PLATFORM STREQUAL "simulation")
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
message(STATUS "Definitions: ${OT_PRIVATE_DEFINES}")
|
||||
add_custom_target(print-ot-config ALL COMMAND echo -e "$<JOIN:$<TARGET_PROPERTY:ot-config,INTERFACE_COMPILE_DEFINITIONS>,\"\\n\">")
|
||||
|
||||
+58
-63
@@ -32,228 +32,223 @@ option(OT_APP_RCP "enable RCP app" ON)
|
||||
|
||||
option(OT_BACKBONE_ROUTER "enable backbone router functionality")
|
||||
if(OT_BACKBONE_ROUTER)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_BORDER_AGENT "enable border agent support")
|
||||
if(OT_BORDER_AGENT)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_BORDER_ROUTER "enable border router support")
|
||||
if(OT_BORDER_ROUTER)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
if(NOT OT_EXTERNAL_MBEDTLS)
|
||||
set(OT_MBEDTLS mbedtls)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=1")
|
||||
else()
|
||||
set(OT_MBEDTLS ${OT_EXTERNAL_MBEDTLS})
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0")
|
||||
endif()
|
||||
|
||||
option(OT_BUILTIN_MBEDTLS_MANAGEMENT "enable builtin mbedtls management" ON)
|
||||
if(OT_BUILTIN_MBEDTLS_MANAGEMENT)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=1")
|
||||
else()
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=0")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=0")
|
||||
endif()
|
||||
|
||||
option(OT_CHANNEL_MANAGER "enable channel manager support")
|
||||
if(OT_CHANNEL_MANAGER)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_CHANNEL_MONITOR "enable channel monitor support")
|
||||
if(OT_CHANNEL_MONITOR)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_CHILD_SUPERVISION "enable child supervision support")
|
||||
if(OT_CHILD_SUPERVISION)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_COAP "enable coap api support")
|
||||
if(OT_COAP)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_COAP_API_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_COAP_API_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_COAPS "enable secure coap api support")
|
||||
if(OT_COAPS)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_COMMISSIONER "enable commissioner support")
|
||||
if(OT_COMMISSIONER)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_CSL_RECEIVER "enable csl receiver")
|
||||
if(OT_CSL_RECEIVER)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DHCP6_CLIENT "enable DHCP6 client support")
|
||||
if(OT_DHCP6_CLIENT)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DHCP6_SERVER "enable DHCP6 server support")
|
||||
if(OT_DHCP6_SERVER)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DIAGNOSTIC "enable diagnostic support")
|
||||
if(OT_DIAGNOSTIC)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_DIAG_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DIAG_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DNS_CLIENT "enable DNS client support")
|
||||
if(OT_DNS_CLIENT)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_ECDSA "enable ECDSA support")
|
||||
if(OT_ECDSA)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_ECDSA_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ECDSA_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_DUA "enable Domain Unicast Address feature for Thread 1.2")
|
||||
if(OT_DUA)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_DUA_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_DUA_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_EXTERNAL_HEAP "enable external heap support")
|
||||
if(OT_EXTERNAL_HEAP)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_EXTERNAL_HEAP_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_EXTERNAL_HEAP_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_IP6_FRAGM "enable ipv6 fragmentation support")
|
||||
if(OT_IP6_FRAGM)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_JAM_DETECTION "enable jam detection support")
|
||||
if(OT_JAM_DETECTION)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_JOINER "enable joiner support")
|
||||
if(OT_JOINER)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_JOINER_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_JOINER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LEGACY "enable legacy network support")
|
||||
if(OT_LEGACY)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LEGACY_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LEGACY_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LINK_RAW "enable link raw service")
|
||||
if(OT_LINK_RAW)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LINK_RAW_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LINK_RAW_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LOG_LEVEL_DYNAMIC "enable dynamic log level control")
|
||||
if(OT_LOG_LEVEL_DYNAMIC)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MAC_FILTER "enable mac filter support")
|
||||
if(OT_MAC_FILTER)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MLE_LONG_ROUTES "enable MLE long routes extension (experimental, breaks Thread conformance)")
|
||||
if(OT_MLE_LONG_ROUTES)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MTD_NETDIAG "enable TMF network diagnostics on MTDs")
|
||||
if(OT_MTD_NETDIAG)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_MULTIPLE_INSTANCE "enable multiple instances")
|
||||
if(OT_MULTIPLE_INSTANCE)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_PLATFORM_NETIF "enable platform netif support")
|
||||
if(OT_PLATFORM_NETIF)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_NCP_VENDOR_HOOK_SOURCE "Enable vendor hook for NCP")
|
||||
if(OT_NCP_VENDOR_HOOK_SOURCE)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_ENABLE_NCP_VENDOR_HOOK=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_PLATFORM_UDP "enable platform UDP support")
|
||||
if(OT_PLATFORM_UDP)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_REFERENCE_DEVICE "enable Thread Test Harness reference device support")
|
||||
if(OT_REFERENCE_DEVICE)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_SERVICE "enable support for injecting Service entries into the Thread Network Data")
|
||||
if(OT_SERVICE)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_SETTINGS_RAM "enable volatile-only storage of settings")
|
||||
if(OT_SETTINGS_RAM)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_SETTINGS_RAM=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_SETTINGS_RAM=1")
|
||||
endif()
|
||||
|
||||
option(OT_SLAAC "enable support for adding of auto-configured SLAAC addresses by OpenThread")
|
||||
if(OT_SLAAC)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_SNTP_CLIENT "enable SNTP Client support")
|
||||
if(OT_SNTP_CLIENT)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_TIME_SYNC "enable the time synchronization service feature")
|
||||
if(OT_TIME_SYNC)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_UDP_FORWARD "enable UDP forward support")
|
||||
if(OT_UDP_FORWARD)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_FULL_LOGS "enable full logs")
|
||||
if(OT_FULL_LOGS)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_API=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_ARP=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_BBR=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_CLI=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_COAP=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_ICMP=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_IP6=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_MAC=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_MEM=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_MLE=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_NETDATA=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_NETDIAG=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_PKT_DUMP=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_PLATFORM=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL=1")
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_LOG_PREPEND_REGION=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_API=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_ARP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_BBR=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_CLI=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_COAP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_ICMP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_IP6=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MAC=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MEM=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_NETDATA=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_NETDIAG=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PKT_DUMP=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PLATFORM=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_PREPEND_REGION=1")
|
||||
endif()
|
||||
|
||||
option(OT_OTNS "enable OTNS support")
|
||||
if(OT_OTNS)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_OTNS_ENABLE=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_OTNS_ENABLE=1")
|
||||
endif()
|
||||
|
||||
# Checks
|
||||
|
||||
@@ -44,15 +44,13 @@ set(COMMON_INCLUDES
|
||||
target_include_directories(ot-cli-ftd PRIVATE ${COMMON_INCLUDES})
|
||||
target_include_directories(ot-cli-mtd PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
target_compile_definitions(ot-cli-ftd PRIVATE ${OT_PRIVATE_DEFINES})
|
||||
target_compile_definitions(ot-cli-mtd PRIVATE ${OT_PRIVATE_DEFINES})
|
||||
|
||||
target_link_libraries(ot-cli-ftd
|
||||
openthread-cli-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
mbedcrypto
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(ot-cli-mtd
|
||||
@@ -61,6 +59,7 @@ target_link_libraries(ot-cli-mtd
|
||||
openthread-mtd
|
||||
${OT_PLATFORM_LIB}
|
||||
mbedcrypto
|
||||
ot-config
|
||||
)
|
||||
|
||||
install(TARGETS ot-cli-ftd ot-cli-mtd
|
||||
|
||||
@@ -37,15 +37,13 @@ add_executable(ot-ncp-mtd
|
||||
target_include_directories(ot-ncp-ftd PRIVATE ${COMMON_INCLUDES})
|
||||
target_include_directories(ot-ncp-mtd PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
target_compile_definitions(ot-ncp-ftd PRIVATE ${OT_PRIVATE_DEFINES})
|
||||
target_compile_definitions(ot-ncp-mtd PRIVATE ${OT_PRIVATE_DEFINES})
|
||||
|
||||
target_link_libraries(ot-ncp-ftd
|
||||
openthread-ncp-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
mbedcrypto
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(ot-ncp-mtd
|
||||
@@ -54,6 +52,7 @@ target_link_libraries(ot-ncp-mtd
|
||||
openthread-mtd
|
||||
${OT_PLATFORM_LIB}
|
||||
mbedcrypto
|
||||
ot-config
|
||||
)
|
||||
|
||||
install(TARGETS ot-ncp-ftd ot-ncp-mtd DESTINATION bin)
|
||||
|
||||
@@ -32,13 +32,12 @@ add_executable(ot-rcp
|
||||
|
||||
target_include_directories(ot-rcp PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
target_compile_definitions(ot-rcp PRIVATE ${OT_PRIVATE_DEFINES})
|
||||
|
||||
target_link_libraries(ot-rcp
|
||||
openthread-rcp
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-radio
|
||||
${OT_PLATFORM_LIB}
|
||||
ot-config
|
||||
)
|
||||
|
||||
install(TARGETS ot-rcp DESTINATION bin)
|
||||
|
||||
@@ -38,8 +38,7 @@ list(APPEND OT_PLATFORM_DEFINES
|
||||
)
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES "MBEDTLS_USER_CONFIG_FILE=\"cc1352-mbedtls-config.h\"")
|
||||
set(OT_PRIVATE_DEFINES ${OT_PRIVATE_DEFINES} PARENT_SCOPE)
|
||||
target_compile_definitions(ot-config INTERFACE "MBEDTLS_USER_CONFIG_FILE=\"cc1352-mbedtls-config.h\"")
|
||||
|
||||
list(APPEND OT_PUBLIC_INCLUDES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/crypto"
|
||||
@@ -72,6 +71,7 @@ target_link_libraries(openthread-cc1352
|
||||
cc13x2-cc26x2-driver
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_options(openthread-cc1352
|
||||
@@ -83,8 +83,6 @@ target_link_options(openthread-cc1352
|
||||
target_compile_definitions(openthread-cc1352
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-cc1352 PRIVATE ${OT_CFLAGS})
|
||||
|
||||
@@ -57,15 +57,13 @@ add_library(openthread-cc2538
|
||||
|
||||
set_property(TARGET openthread-cc2538 PROPERTY C_STANDARD 99)
|
||||
|
||||
target_link_libraries(openthread-cc2538 PRIVATE openthread-platform-utils)
|
||||
target_link_libraries(openthread-cc2538 PRIVATE openthread-platform-utils ot-config)
|
||||
target_link_options(openthread-cc2538 PUBLIC -T${PROJECT_SOURCE_DIR}/examples/platforms/cc2538/cc2538.ld)
|
||||
target_link_options(openthread-cc2538 PUBLIC -Wl,--gc-sections -Wl,-Map=$<TARGET_PROPERTY:NAME>.map)
|
||||
|
||||
target_compile_definitions(openthread-cc2538
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-cc2538 PRIVATE
|
||||
|
||||
@@ -38,8 +38,7 @@ list(APPEND OT_PLATFORM_DEFINES
|
||||
)
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES "MBEDTLS_USER_CONFIG_FILE=\"cc2650-mbedtls-config.h\"")
|
||||
set(OT_PRIVATE_DEFINES ${OT_PRIVATE_DEFINES} PARENT_SCOPE)
|
||||
target_compile_definitions(ot-config INTERFACE "MBEDTLS_USER_CONFIG_FILE=\"cc2650-mbedtls-config.h\"")
|
||||
list(APPEND OT_PUBLIC_INCLUDES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/crypto"
|
||||
"${PROJECT_SOURCE_DIR}/third_party/ti/devices/cc26x0"
|
||||
@@ -73,6 +72,7 @@ target_link_libraries(openthread-cc2650
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
openthread-platform-utils
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_options(openthread-cc2650
|
||||
@@ -84,8 +84,6 @@ target_link_options(openthread-cc2650
|
||||
target_compile_definitions(openthread-cc2650
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-cc2650 PRIVATE ${OT_CFLAGS})
|
||||
|
||||
@@ -38,8 +38,7 @@ list(APPEND OT_PLATFORM_DEFINES
|
||||
)
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES "MBEDTLS_USER_CONFIG_FILE=\"cc2652-mbedtls-config.h\"")
|
||||
set(OT_PRIVATE_DEFINES ${OT_PRIVATE_DEFINES} PARENT_SCOPE)
|
||||
target_compile_definitions(ot-config INTERFACE "MBEDTLS_USER_CONFIG_FILE=\"cc2652-mbedtls-config.h\"")
|
||||
|
||||
list(APPEND OT_PUBLIC_INCLUDES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/crypto"
|
||||
@@ -72,6 +71,7 @@ target_link_libraries(openthread-cc2652
|
||||
cc13x2-cc26x2-driver
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_options(openthread-cc2652
|
||||
@@ -82,8 +82,6 @@ target_link_options(openthread-cc2652
|
||||
target_compile_definitions(openthread-cc2652
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-cc2652
|
||||
|
||||
@@ -53,15 +53,13 @@ add_library(openthread-kw41z
|
||||
)
|
||||
|
||||
set_property(TARGET openthread-kw41z PROPERTY C_STANDARD 99)
|
||||
target_link_libraries(openthread-kw41z PRIVATE nxp-kw41z-driver)
|
||||
target_link_libraries(openthread-kw41z PRIVATE nxp-kw41z-driver ot-config)
|
||||
target_link_options(openthread-kw41z PRIVATE -T${PROJECT_SOURCE_DIR}/examples/platforms/kw41z/MKW41Z512xxx4.ld)
|
||||
target_link_options(openthread-kw41z PRIVATE -Wl,--gc-sections -Wl,-Map=$<TARGET_PROPERTY:NAME>.map)
|
||||
|
||||
target_compile_definitions(openthread-kw41z
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-kw41z
|
||||
|
||||
@@ -38,7 +38,7 @@ list(APPEND OT_PLATFORM_DEFINES
|
||||
)
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES "MBEDTLS_USER_CONFIG_FILE=\"qpg6095-mbedtls-config.h\"")
|
||||
target_compile_definitions(ot-config INTERFACE "MBEDTLS_USER_CONFIG_FILE=\"qpg6095-mbedtls-config.h\"")
|
||||
|
||||
list(APPEND OT_PUBLIC_INCLUDES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/crypto"
|
||||
@@ -73,6 +73,7 @@ target_link_libraries(openthread-qpg6095
|
||||
PRIVATE
|
||||
qpg6095-driver
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_options(openthread-qpg6095
|
||||
@@ -85,8 +86,6 @@ target_link_options(openthread-qpg6095
|
||||
target_compile_definitions(openthread-qpg6095
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-qpg6095
|
||||
|
||||
@@ -38,7 +38,7 @@ list(APPEND OT_PLATFORM_DEFINES
|
||||
)
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES "MBEDTLS_USER_CONFIG_FILE=\"samr21-mbedtls-config.h\"")
|
||||
target_compile_definitions(ot-config INTERFACE "MBEDTLS_USER_CONFIG_FILE=\"samr21-mbedtls-config.h\"")
|
||||
list(APPEND OT_PUBLIC_INCLUDES
|
||||
"${PROJECT_SOURCE_DIR}/examples/platforms/samr21/crypto"
|
||||
)
|
||||
@@ -71,6 +71,7 @@ target_link_libraries(openthread-samr21
|
||||
samr21-driver
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_options(openthread-samr21
|
||||
@@ -82,8 +83,6 @@ target_link_options(openthread-samr21
|
||||
target_compile_definitions(openthread-samr21
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-samr21
|
||||
|
||||
@@ -30,12 +30,12 @@ set(OT_PLATFORM_LIB "openthread-simulation" PARENT_SCOPE)
|
||||
|
||||
option(OT_SIMULATION_VIRTUAL_TIME "enable virtual time")
|
||||
if(OT_SIMULATION_VIRTUAL_TIME)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_SIMULATION_VIRTUAL_TIME=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_SIMULATION_VIRTUAL_TIME=1")
|
||||
endif()
|
||||
|
||||
option(OT_SIMULATION_VIRTUAL_TIME_UART "enable virtual time for UART")
|
||||
if(OT_SIMULATION_VIRTUAL_TIME_UART)
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_SIMULATION_VIRTUAL_TIME_UART=1")
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_SIMULATION_VIRTUAL_TIME_UART=1")
|
||||
endif()
|
||||
|
||||
if(NOT OT_CONFIG)
|
||||
@@ -78,14 +78,14 @@ if(LIBRT)
|
||||
target_link_libraries(openthread-simulation PRIVATE ${LIBRT})
|
||||
endif()
|
||||
|
||||
target_link_libraries(openthread-simulation PRIVATE openthread-platform-utils)
|
||||
target_link_libraries(openthread-simulation PRIVATE openthread-platform)
|
||||
target_link_libraries(openthread-simulation PRIVATE
|
||||
openthread-platform-utils
|
||||
openthread-platform
|
||||
ot-config)
|
||||
|
||||
target_compile_definitions(openthread-simulation
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-simulation PRIVATE
|
||||
|
||||
@@ -34,10 +34,6 @@ add_library(openthread-platform-utils OBJECT
|
||||
soft_source_match_table.c
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-platform-utils PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_include_directories(openthread-platform-utils PRIVATE
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
${OT_PRIVATE_INCLUDES}
|
||||
@@ -50,3 +46,4 @@ target_include_directories(openthread-platform-utils PRIVATE
|
||||
# Provide a static library implementation of platform-utils for non-cmake platforms
|
||||
add_library(openthread-platform-utils-static $<TARGET_OBJECTS:openthread-platform-utils>)
|
||||
target_link_libraries(openthread-platform-utils-static PUBLIC openthread-platform-utils)
|
||||
target_link_libraries(openthread-platform-utils PRIVATE ot-config)
|
||||
|
||||
@@ -37,12 +37,10 @@ set_target_properties(
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-cli-ftd PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_FTD=1
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-cli-mtd PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_MTD=1
|
||||
)
|
||||
|
||||
@@ -84,6 +82,7 @@ target_link_libraries(openthread-cli-ftd
|
||||
openthread-ftd
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-cli-mtd
|
||||
@@ -91,4 +90,5 @@ target_link_libraries(openthread-cli-mtd
|
||||
openthread-mtd
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
@@ -38,17 +38,14 @@ set_target_properties(
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-ftd PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_FTD=1
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-mtd PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_MTD=1
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-radio PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_RADIO=1
|
||||
)
|
||||
|
||||
@@ -249,14 +246,17 @@ target_sources(openthread-radio PRIVATE
|
||||
target_link_libraries(openthread-ftd
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-mtd
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-radio
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
@@ -45,9 +45,7 @@ target_include_directories(openthread-hdlc
|
||||
${OT_PRIVATE_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-hdlc PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
target_link_libraries(openthread-hdlc PRIVATE ot-config)
|
||||
|
||||
target_compile_options(openthread-hdlc PRIVATE
|
||||
${OT_CFLAGS}
|
||||
|
||||
@@ -39,9 +39,7 @@ target_include_directories(openthread-platform
|
||||
${OT_PRIVATE_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-platform PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
target_link_libraries(openthread-platform PRIVATE ot-config)
|
||||
|
||||
target_compile_options(openthread-platform PRIVATE
|
||||
${OT_CFLAGS}
|
||||
|
||||
@@ -37,14 +37,12 @@ set_target_properties(
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-spinel-ncp PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_FTD=1
|
||||
OPENTHREAD_CONFIG_NCP_UART_ENABLE=1
|
||||
PUBLIC OPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE=1
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-spinel-rcp PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_RADIO=1
|
||||
OPENTHREAD_CONFIG_NCP_UART_ENABLE=1
|
||||
PUBLIC OPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE=0
|
||||
@@ -76,3 +74,6 @@ 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)
|
||||
|
||||
@@ -39,19 +39,16 @@ set_target_properties(
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-ncp-ftd PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_FTD=1
|
||||
OPENTHREAD_CONFIG_NCP_UART_ENABLE=1
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-ncp-mtd PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_MTD=1
|
||||
OPENTHREAD_CONFIG_NCP_UART_ENABLE=1
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-rcp PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
OPENTHREAD_RADIO=1
|
||||
OPENTHREAD_CONFIG_NCP_UART_ENABLE=1
|
||||
)
|
||||
@@ -85,10 +82,10 @@ set(COMMON_SOURCES
|
||||
ncp_uart.cpp
|
||||
)
|
||||
|
||||
if(DEFINED OT_NCP_VENDOR_HOOK_SOURCE)
|
||||
if(NOT OT_NCP_VENDOR_HOOK_SOURCE STREQUAL "OFF")
|
||||
list(APPEND COMMON_SOURCES ${OT_NCP_VENDOR_HOOK_SOURCE})
|
||||
endif()
|
||||
set(OT_NCP_VENDOR_HOOK_SOURCE "" CACHE STRING "set vendor hook source file for NCP")
|
||||
if(OT_NCP_VENDOR_HOOK_SOURCE)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_ENABLE_NCP_VENDOR_HOOK=1")
|
||||
list(APPEND COMMON_SOURCES ${OT_NCP_VENDOR_HOOK_SOURCE})
|
||||
endif()
|
||||
|
||||
target_include_directories(openthread-ncp-ftd PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES})
|
||||
@@ -115,6 +112,7 @@ target_link_libraries(openthread-ncp-ftd
|
||||
${OT_MBEDTLS}
|
||||
openthread-hdlc
|
||||
openthread-spinel-ncp
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-ncp-mtd
|
||||
@@ -124,6 +122,7 @@ target_link_libraries(openthread-ncp-mtd
|
||||
${OT_MBEDTLS}
|
||||
openthread-hdlc
|
||||
openthread-spinel-ncp
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-rcp
|
||||
@@ -132,4 +131,5 @@ target_link_libraries(openthread-rcp
|
||||
PRIVATE
|
||||
openthread-hdlc
|
||||
openthread-spinel-rcp
|
||||
ot-config
|
||||
)
|
||||
|
||||
@@ -84,6 +84,7 @@ set_target_properties(
|
||||
|
||||
target_link_libraries(openthread-posix PUBLIC
|
||||
openthread-platform
|
||||
ot-config
|
||||
util
|
||||
)
|
||||
|
||||
@@ -92,7 +93,6 @@ target_compile_definitions(openthread-posix
|
||||
${OT_PUBLIC_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PLATFORM_DEFINES}
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-posix PRIVATE
|
||||
|
||||
@@ -34,6 +34,7 @@ set(COMMON_SOURCES
|
||||
set(COMMON_LIBS
|
||||
openthread-ftd
|
||||
openthread-ncp-ftd
|
||||
ot-config
|
||||
${OT_MBEDTLS}
|
||||
util
|
||||
)
|
||||
@@ -60,11 +61,6 @@ target_include_directories(test-aes
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-aes
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-aes
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -87,11 +83,6 @@ target_include_directories(test-child
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-child
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-child
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -114,11 +105,6 @@ target_include_directories(test-child-table
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-child-table
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-child-table
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -141,11 +127,6 @@ target_include_directories(test-flash
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-flash
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-flash
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -168,11 +149,6 @@ target_include_directories(test-heap
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-heap
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-heap
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -195,11 +171,6 @@ target_include_directories(test-hmac-sha256
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-hmac-sha256
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-hmac-sha256
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -222,11 +193,6 @@ target_include_directories(test-ip6-address
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-ip6-address
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-ip6-address
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -249,11 +215,6 @@ target_include_directories(test-link-quality
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-link-quality
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-link-quality
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -276,11 +237,6 @@ target_include_directories(test-linked-list
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-linked-list
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-linked-list
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -303,11 +259,6 @@ target_include_directories(test-lowpan
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-lowpan
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-lowpan
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -330,11 +281,6 @@ target_include_directories(test-mac-frame
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-mac-frame
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-mac-frame
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -357,11 +303,6 @@ target_include_directories(test-message
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-message
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-message
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -384,11 +325,6 @@ target_include_directories(test-message-queue
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-message-queue
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-message-queue
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -411,11 +347,6 @@ target_include_directories(test-netif
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-netif
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-netif
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -438,11 +369,6 @@ target_include_directories(test-network-data
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-network-data
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-network-data
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -465,11 +391,6 @@ target_include_directories(test-priority-queue
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-priority-queue
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-priority-queue
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -492,11 +413,6 @@ target_include_directories(test-pskc
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-pskc
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-pskc
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -519,11 +435,6 @@ target_include_directories(test-string
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-string
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-string
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
@@ -546,11 +457,6 @@ target_include_directories(test-timer
|
||||
${COMMON_INCLUDES}
|
||||
)
|
||||
|
||||
target_compile_definitions(test-timer
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(test-timer
|
||||
PRIVATE
|
||||
${COMMON_COMPILE_OPTIONS}
|
||||
|
||||
Vendored
+3
-3
@@ -39,7 +39,7 @@ target_compile_definitions(mbedtls
|
||||
PUBLIC
|
||||
"MBEDTLS_CONFIG_FILE=$<IF:$<BOOL:${OT_MBEDTLS_CONFIG_FILE}>,${OT_MBEDTLS_CONFIG_FILE},${OT_MBEDTLS_DEFAULT_CONFIG_FILE}>"
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
$<TARGET_PROPERTY:ot-config,INTERFACE_COMPILE_DEFINITIONS>
|
||||
)
|
||||
target_include_directories(mbedtls
|
||||
PUBLIC
|
||||
@@ -54,7 +54,7 @@ target_compile_definitions(mbedx509
|
||||
PUBLIC
|
||||
"MBEDTLS_CONFIG_FILE=$<IF:$<BOOL:${OT_MBEDTLS_CONFIG_FILE}>,${OT_MBEDTLS_CONFIG_FILE},${OT_MBEDTLS_DEFAULT_CONFIG_FILE}>"
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
$<TARGET_PROPERTY:ot-config,INTERFACE_COMPILE_DEFINITIONS>
|
||||
)
|
||||
target_include_directories(mbedx509
|
||||
PUBLIC
|
||||
@@ -69,7 +69,7 @@ target_compile_definitions(mbedcrypto
|
||||
PUBLIC
|
||||
"MBEDTLS_CONFIG_FILE=$<IF:$<BOOL:${OT_MBEDTLS_CONFIG_FILE}>,${OT_MBEDTLS_CONFIG_FILE},${OT_MBEDTLS_DEFAULT_CONFIG_FILE}>"
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
$<TARGET_PROPERTY:ot-config,INTERFACE_COMPILE_DEFINITIONS>
|
||||
)
|
||||
target_include_directories(mbedcrypto
|
||||
PUBLIC
|
||||
|
||||
Vendored
+2
-2
@@ -60,6 +60,8 @@ target_link_options(samr21-driver
|
||||
-T${PROJECT_SOURCE_DIR}/third_party/microchip/include/samr21x18a.ld
|
||||
)
|
||||
|
||||
target_link_libraries(samr21-driver PRIVATE ot-config)
|
||||
|
||||
target_compile_definitions(samr21-driver
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
@@ -72,8 +74,6 @@ target_compile_definitions(samr21-driver
|
||||
-DEXTINT_CALLBACK_MODE=true
|
||||
-DSPI_CALLBACK_MODE=false
|
||||
-DCYCLE_MODE
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(samr21-driver
|
||||
|
||||
Vendored
+2
-2
@@ -61,8 +61,6 @@ if(OT_PLATFORM STREQUAL "kw41z")
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
-DCPU_MKW41Z512VHT4
|
||||
PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(nxp-kw41z-driver
|
||||
@@ -83,4 +81,6 @@ if(OT_PLATFORM STREQUAL "kw41z")
|
||||
MKW41Z4/XCVR
|
||||
MKW41Z4/XCVR/cfgs_kw4x_3x_2x
|
||||
)
|
||||
|
||||
target_link_libraries(nxp-kw41z-driver PRIVATE ot-config)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user