From ecdd5312a33ca4ee3d6e84a599d2cf182523ae41 Mon Sep 17 00:00:00 2001 From: Kangping Date: Tue, 27 Sep 2022 23:58:23 +0800 Subject: [PATCH] [posix] fix OT_DAEMON flag definitions (#8203) We have to add the `OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE` definition to `ot-config` because OpenThread core libraries will set config file to "openthrad-core-posix-config.h" which depends on `OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE` to correctly enable PLATFORM_NETIF and PLATFORM_UDP features. Otherwise, OpenThread core and posix libraries will use different feature definitions. --- src/posix/platform/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/posix/platform/CMakeLists.txt b/src/posix/platform/CMakeLists.txt index 1f9081747..66706bea3 100644 --- a/src/posix/platform/CMakeLists.txt +++ b/src/posix/platform/CMakeLists.txt @@ -35,6 +35,14 @@ if(OT_DAEMON) target_compile_definitions(ot-posix-config INTERFACE "OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE=1" ) + + # We have to add this definition to `ot-config` because openthread core + # libraries will set config file to "openthrad-core-posix-config.h" which + # depends on `OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE` to correctly enable + # PLATFORM_NETIF and PLATFORM_UDP features. Otherwise, openthread core and + # posix libraries will use different feature definitions. + list(APPEND OT_PLATFORM_DEFINES "OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE=1") + set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE) endif() option(OT_POSIX_INSTALL_EXTERNAL_ROUTES "Install External Routes as IPv6 routes" ON)