[spinel] allow custom config file for lib spinel (#10449)

This commit is contained in:
Li Cao
2024-07-01 19:16:39 -07:00
committed by GitHub
parent 2d3df2acee
commit 41b91a982b
3 changed files with 22 additions and 0 deletions
+8
View File
@@ -26,6 +26,14 @@
# POSSIBILITY OF SUCH DAMAGE.
#
add_library(ot-lib-config INTERFACE)
set(OT_LIB_CONFIG "" CACHE STRING "Lib project-specific config header file")
if (OT_LIB_CONFIG)
target_compile_definitions(ot-lib-config INTERFACE "OPENTHREAD_PROJECT_LIB_CONFIG_FILE=\"${OT_LIB_CONFIG}\"")
message(STATUS "OT_LIB_CONFIG=\"${OT_LIB_CONFIG}\"")
endif()
add_subdirectory(hdlc)
add_subdirectory(platform)
add_subdirectory(spinel)
+6
View File
@@ -99,17 +99,23 @@ target_sources(openthread-spinel-ncp PRIVATE ${COMMON_SOURCES})
target_sources(openthread-spinel-rcp PRIVATE ${COMMON_SOURCES})
target_link_libraries(openthread-radio-spinel
INTERFACE
ot-lib-config
PRIVATE
ot-config
)
target_link_libraries(openthread-spinel-ncp
INTERFACE
ot-lib-config
PRIVATE
ot-config-ftd
ot-config
)
target_link_libraries(openthread-spinel-rcp
INTERFACE
ot-lib-config
PRIVATE
ot-config-radio
ot-config
@@ -34,6 +34,14 @@
#ifndef OPENTHREAD_SPINEL_CONFIG_H_
#define OPENTHREAD_SPINEL_CONFIG_H_
/**
* Include project specific lib config file if defined.
*
*/
#ifdef OPENTHREAD_PROJECT_LIB_CONFIG_FILE
#include OPENTHREAD_PROJECT_LIB_CONFIG_FILE
#endif
/**
* @def OPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE
*