mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 13:47:47 +00:00
[build] enhancements for OpenThread border router (#4604)
This commit makes a few small changes so that the cmake build files can be used by project depending on this project.
This commit is contained in:
@@ -108,15 +108,6 @@ endif()
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES ${OT_PLATFORM_DEFINES})
|
||||
|
||||
if(OT_BUILTIN_MBEDTLS)
|
||||
list(APPEND OT_PRIVATE_INCLUDES ${PROJECT_SOURCE_DIR}/third_party/mbedtls)
|
||||
list(APPEND OT_PRIVATE_INCLUDES ${PROJECT_SOURCE_DIR}/third_party/mbedtls/repo/include)
|
||||
|
||||
list(APPEND OT_PRIVATE_DEFINES
|
||||
"MBEDTLS_CONFIG_FILE=\"mbedtls-config.h\""
|
||||
)
|
||||
endif()
|
||||
|
||||
if(OT_PLATFORM STREQUAL "posix-host")
|
||||
add_subdirectory(src/posix)
|
||||
elseif(NOT OT_PLATFORM MATCHES "none")
|
||||
|
||||
@@ -201,3 +201,10 @@ if(OT_BUILTIN_MBEDTLS)
|
||||
else()
|
||||
list(APPEND OT_PRIVATE_DEFINES "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")
|
||||
else()
|
||||
list(APPEND OT_PRIVATE_DEFINES "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=0")
|
||||
endif()
|
||||
|
||||
@@ -78,3 +78,13 @@ target_include_directories(openthread-cli-mtd PUBLIC ${OT_PUBLIC_INCLUDES} PRIVA
|
||||
|
||||
target_sources(openthread-cli-ftd PRIVATE ${COMMON_SOURCES})
|
||||
target_sources(openthread-cli-mtd PRIVATE ${COMMON_SOURCES})
|
||||
|
||||
target_link_libraries(openthread-cli-ftd
|
||||
PUBLIC
|
||||
openthread-ftd
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-cli-mtd
|
||||
PUBLIC
|
||||
openthread-mtd
|
||||
)
|
||||
|
||||
@@ -232,3 +232,13 @@ target_sources(openthread-radio PRIVATE
|
||||
thread/link_quality.cpp
|
||||
utils/parse_cmdline.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-ftd
|
||||
PUBLIC
|
||||
mbedcrypto
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-mtd
|
||||
PUBLIC
|
||||
mbedcrypto
|
||||
)
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "common/instance.hpp"
|
||||
#include "common/locator-getters.hpp"
|
||||
#include "common/random.hpp"
|
||||
#include "mac/mac.hpp"
|
||||
#include "mac/mac_frame.hpp"
|
||||
#include "utils/parse_cmdline.hpp"
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include "common/logging.hpp"
|
||||
#include "common/new.hpp"
|
||||
#include "thread/router_table.hpp"
|
||||
|
||||
namespace ot {
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "common/locator-getters.hpp"
|
||||
#include "common/logging.hpp"
|
||||
#include "common/random.hpp"
|
||||
#include "mac/mac.hpp"
|
||||
#include "mac/mac_frame.hpp"
|
||||
|
||||
#if OPENTHREAD_RADIO || OPENTHREAD_CONFIG_LINK_RAW_ENABLE
|
||||
|
||||
@@ -37,8 +37,11 @@
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/debug.hpp"
|
||||
|
||||
#if OPENTHREAD_MTD || OPENTHREAD_FTD
|
||||
#include "crypto/aes_ccm.hpp"
|
||||
#include "thread/key_manager.hpp"
|
||||
#endif
|
||||
|
||||
namespace ot {
|
||||
namespace Mac {
|
||||
|
||||
@@ -36,7 +36,10 @@
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/instance.hpp"
|
||||
#include "common/locator-getters.hpp"
|
||||
|
||||
#if OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
#include "mac/mac.hpp"
|
||||
#endif
|
||||
|
||||
namespace ot {
|
||||
namespace Mac {
|
||||
|
||||
+18
-9
@@ -93,17 +93,26 @@ target_sources(openthread-ncp-ftd PRIVATE ${COMMON_SOURCES})
|
||||
target_sources(openthread-ncp-mtd PRIVATE ${COMMON_SOURCES})
|
||||
target_sources(openthread-rcp PRIVATE ${COMMON_SOURCES})
|
||||
|
||||
target_link_libraries(openthread-ncp-ftd PRIVATE
|
||||
openthread-hdlc
|
||||
openthread-spinel-ncp
|
||||
target_link_libraries(openthread-ncp-ftd
|
||||
PUBLIC
|
||||
openthread-ftd
|
||||
PRIVATE
|
||||
openthread-hdlc
|
||||
openthread-spinel-ncp
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-ncp-mtd PRIVATE
|
||||
openthread-hdlc
|
||||
openthread-spinel-ncp
|
||||
target_link_libraries(openthread-ncp-mtd
|
||||
PUBLIC
|
||||
openthread-mtd
|
||||
PRIVATE
|
||||
openthread-hdlc
|
||||
openthread-spinel-ncp
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-rcp PRIVATE
|
||||
openthread-hdlc
|
||||
openthread-spinel-rcp
|
||||
target_link_libraries(openthread-rcp
|
||||
PUBLIC
|
||||
openthread-radio
|
||||
PRIVATE
|
||||
openthread-hdlc
|
||||
openthread-spinel-rcp
|
||||
)
|
||||
|
||||
@@ -63,8 +63,11 @@ target_link_libraries(openthread-posix PUBLIC
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-posix
|
||||
PUBLIC ${OT_PLATFORM_DEFINES}
|
||||
PRIVATE ${OT_PRIVATE_DEFINES}
|
||||
PUBLIC
|
||||
${OT_PUBLIC_DEFINES}
|
||||
PRIVATE
|
||||
${OT_PLATFORM_DEFINES}
|
||||
${OT_PRIVATE_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-posix PRIVATE
|
||||
|
||||
Vendored
+24
-6
@@ -28,16 +28,33 @@
|
||||
|
||||
add_library(mbedcrypto)
|
||||
|
||||
target_compile_definitions(mbedcrypto PRIVATE
|
||||
${OT_PRIVATE_DEFINES}
|
||||
set(OT_MBEDTLS_DEFAULT_CONFIG_FILE "\"mbedtls-config.h\"")
|
||||
|
||||
set(OT_MBEDTLS_CONFIG_FILE "" CACHE STRING "The mbedTLS config file")
|
||||
|
||||
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_include_directories(mbedcrypto PRIVATE
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
${OT_PRIVATE_INCLUDES}
|
||||
${PROJECT_SOURCE_DIR}/src/core
|
||||
target_include_directories(mbedcrypto
|
||||
PUBLIC
|
||||
${PROJECT_SOURCE_DIR}/third_party/mbedtls/repo/include
|
||||
PRIVATE
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
${OT_PRIVATE_INCLUDES}
|
||||
)
|
||||
|
||||
if (NOT OT_MBEDTLS_CONFIG_FILE)
|
||||
target_include_directories(mbedcrypto
|
||||
PUBLIC
|
||||
${PROJECT_SOURCE_DIR}/src/core
|
||||
${PROJECT_SOURCE_DIR}/third_party/mbedtls
|
||||
)
|
||||
endif()
|
||||
|
||||
target_sources(mbedcrypto PRIVATE
|
||||
repo/library/aes.c
|
||||
repo/library/asn1parse.c
|
||||
@@ -75,6 +92,7 @@ target_sources(mbedcrypto PRIVATE
|
||||
repo/library/ssl_ticket.c
|
||||
repo/library/ssl_tls.c
|
||||
repo/library/threading.c
|
||||
repo/library/timing.c
|
||||
repo/library/x509.c
|
||||
repo/library/x509_crt.c
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user