From 6a9d92545beefad519dba170c9646cbb2c4744f5 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Fri, 9 Jan 2026 03:19:40 +0800 Subject: [PATCH] [gn] fix build with openthread_enable_core_config_args is false (#12265) This commit fixes building with gn when openthread_enable_core_config_args is false, which causes openthread_config_tcp_enable undefined. --- script/check-gn-build | 1 + src/core/BUILD.gn | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/script/check-gn-build b/script/check-gn-build index 3b8545710..1251f8d69 100755 --- a/script/check-gn-build +++ b/script/check-gn-build @@ -45,6 +45,7 @@ check_build() main() { + check_build --args="use_clang=true openthread_project_core_config_file=\"../examples/platforms/simulation/openthread-core-simulation-config.h\"" for thread_version in 1.4 1.1; do for use_clang in true false; do check_build --args="use_clang=$use_clang openthread_config_thread_version=\"$thread_version\"" diff --git a/src/core/BUILD.gn b/src/core/BUILD.gn index 0d7f669da..2f6a85a32 100644 --- a/src/core/BUILD.gn +++ b/src/core/BUILD.gn @@ -785,7 +785,7 @@ group("libopenthread_platform") { static_library("libopenthread-ftd") { sources = openthread_core_sources - if (openthread_config_tcp_enable) { + if (openthread_enable_core_config_args && openthread_config_tcp_enable) { deps = [ "../../third_party/tcplp" ] } public_deps = [ ":libopenthread_platform" ] @@ -794,7 +794,7 @@ static_library("libopenthread-ftd") { static_library("libopenthread-mtd") { sources = openthread_core_sources - if (openthread_config_tcp_enable) { + if (openthread_enable_core_config_args && openthread_config_tcp_enable) { deps = [ "../../third_party/tcplp" ] } public_deps = [ ":libopenthread_platform" ]