From 7942b00eee6ecede963fd38c1bc5ce870f8797c6 Mon Sep 17 00:00:00 2001 From: Philipp-Wohlgenannt-Tridonic-com <65544915+Philipp-Wohlgenannt-Tridonic-com@users.noreply.github.com> Date: Tue, 26 May 2020 00:58:06 +0200 Subject: [PATCH] [cmake] add NCP vendor hook option from Zephyr (#4983) Signed-off-by: Philipp Wohlgenannt --- etc/cmake/options.cmake | 5 +++++ src/ncp/CMakeLists.txt | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/etc/cmake/options.cmake b/etc/cmake/options.cmake index 4a5cddc69..6b59c9233 100644 --- a/etc/cmake/options.cmake +++ b/etc/cmake/options.cmake @@ -185,6 +185,11 @@ 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") +endif() + option(OT_PLATFORM_UDP "enable platform UDP support") if(OT_PLATFORM_UDP) list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1") diff --git a/src/ncp/CMakeLists.txt b/src/ncp/CMakeLists.txt index 01c6383ce..dc3836a7e 100644 --- a/src/ncp/CMakeLists.txt +++ b/src/ncp/CMakeLists.txt @@ -85,6 +85,12 @@ 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() +endif() + target_include_directories(openthread-ncp-ftd PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES}) target_include_directories(openthread-ncp-mtd PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES}) target_include_directories(openthread-rcp PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES})