[cmake] update posix-host cmake to allow OT_CONFIG option to be specified (#4637)

This commit changes the `CMakeLists.txt` for posix host platform to
allow the OpenThread config header file to be specified through the
`OT_CONFIG` option. Similar to other platforms, if no config header is
provided the platform can choose to provide a default one (in the
posix host case we use "openthread-core-posix-config.h" as the
default).
This commit is contained in:
Abtin Keshavarzian
2020-03-05 09:18:57 -08:00
committed by Jonathan Hui
parent b2866e26a1
commit 62e781d63a
+8 -1
View File
@@ -33,15 +33,22 @@ if(OT_DAEMON)
list(APPEND OT_PLATFORM_DEFINES "OPENTHREAD_ENABLE_POSIX_APP_DAEMON=1")
endif()
if(NOT OT_CONFIG)
set(OT_CONFIG "openthread-core-posix-config.h")
set(OT_CONFIG ${OT_CONFIG} PARENT_SCOPE)
endif()
list(APPEND OT_PLATFORM_DEFINES
"OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1"
"OPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
"OPENTHREAD_POSIX=1"
"OPENTHREAD_POSIX_RCP_UART_ENABLE=1"
"OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-core-posix-config.h\""
)
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
list(APPEND OT_PLATFORM_DEFINES "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"")
add_library(openthread-posix
alarm.cpp
entropy.cpp