mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[cmake] allow set extension sources in cmake (#5419)
This commit is contained in:
@@ -44,6 +44,8 @@ build_all_features()
|
||||
"$(dirname "$0")"/cmake-build simulation -DOT_OTNS=ON -DOT_SIMULATION_VIRTUAL_TIME=ON
|
||||
reset_source
|
||||
"$(dirname "$0")"/cmake-build simulation -DOT_OTNS=ON -DOT_SIMULATION_VIRTUAL_TIME=ON -DOT_ASSERT=OFF
|
||||
reset_source
|
||||
"$(dirname "$0")"/cmake-build simulation -DOT_VENDOR_EXTENSION=../../src/core/common/extension_example.cpp
|
||||
}
|
||||
|
||||
build_toranj()
|
||||
|
||||
@@ -217,6 +217,11 @@ target_include_directories(openthread-ftd PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE $
|
||||
target_include_directories(openthread-mtd PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES})
|
||||
target_include_directories(openthread-radio PUBLIC ${OT_PUBLIC_INCLUDES} PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
set(OT_VENDOR_EXTENSION "" CACHE STRING "specify a C++ source file built as part of OpenThread core library")
|
||||
if(OT_VENDOR_EXTENSION)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_ENABLE_VENDOR_EXTENSION=1")
|
||||
list(APPEND COMMON_SOURCES ${OT_VENDOR_EXTENSION})
|
||||
endif()
|
||||
target_sources(openthread-ftd PRIVATE ${COMMON_SOURCES})
|
||||
target_sources(openthread-mtd PRIVATE ${COMMON_SOURCES})
|
||||
|
||||
@@ -248,6 +253,10 @@ target_sources(openthread-radio PRIVATE
|
||||
utils/parse_cmdline.cpp
|
||||
)
|
||||
|
||||
if(OT_VENDOR_EXTENSION)
|
||||
target_sources(openthread-radio PRIVATE ${OT_VENDOR_EXTENSION})
|
||||
endif()
|
||||
|
||||
target_link_libraries(openthread-ftd
|
||||
PRIVATE
|
||||
${OT_MBEDTLS}
|
||||
|
||||
Reference in New Issue
Block a user