From 2159776c302cec2ce8419e71cafbd41fbf679b2b Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Mon, 21 Jun 2021 14:54:38 -0400 Subject: [PATCH] Remove lwIP from src/inet deps in socket builds (#7785) We're getting a bunch of lwIP #defines in Linux builds, even though these builds don't use lwIP. Fix the src/inet dependency to check chip_system_config_use_lwip, which controls whether CHIP uses lwIP in its networking abstractions. This requires annotating some conditional #includes with // nogncheck because the checker doesn't preprocess the file. --- src/inet/BUILD.gn | 2 +- src/inet/RawEndPoint.cpp | 6 +++--- src/inet/UDPEndPoint.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index 632958b4b710c3..811ac5d5c5fb96 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -103,7 +103,7 @@ static_library("inet") { "${nlio_root}:nlio", ] - if (chip_with_lwip) { + if (chip_system_config_use_lwip) { public_deps += [ "${chip_root}/src/lwip" ] } diff --git a/src/inet/RawEndPoint.cpp b/src/inet/RawEndPoint.cpp index 4fe3c1db997c7b..d11d24cf09d00b 100644 --- a/src/inet/RawEndPoint.cpp +++ b/src/inet/RawEndPoint.cpp @@ -43,9 +43,9 @@ #include #include #if CHIP_HAVE_CONFIG_H -#include -#endif // CHIP_HAVE_CONFIG_H -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP +#include // nogncheck +#endif // CHIP_HAVE_CONFIG_H +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP #if CHIP_SYSTEM_CONFIG_USE_SOCKETS #include diff --git a/src/inet/UDPEndPoint.cpp b/src/inet/UDPEndPoint.cpp index c1bd4edea63c46..e85da7edf4237a 100644 --- a/src/inet/UDPEndPoint.cpp +++ b/src/inet/UDPEndPoint.cpp @@ -42,9 +42,9 @@ #include #include #if CHIP_HAVE_CONFIG_H -#include -#endif // CHIP_HAVE_CONFIG_H -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP +#include // nogncheck +#endif // CHIP_HAVE_CONFIG_H +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP #if CHIP_SYSTEM_CONFIG_USE_SOCKETS #if HAVE_SYS_SOCKET_H