From 62e781d63affef09ebd93dc21c1a5c8e00fd2c6b Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 4 Mar 2020 17:20:15 -0800 Subject: [PATCH] [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). --- src/posix/platform/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/posix/platform/CMakeLists.txt b/src/posix/platform/CMakeLists.txt index d9c4d10f8..0e38520b1 100644 --- a/src/posix/platform/CMakeLists.txt +++ b/src/posix/platform/CMakeLists.txt @@ -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