Skip to content

Commit

Permalink
Remove lwIP from src/inet deps in socket builds (#7785)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mspang authored and pull[bot] committed Jul 2, 2021
1 parent 9d4c417 commit 2159776
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}

Expand Down
6 changes: 3 additions & 3 deletions src/inet/RawEndPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
#include <lwip/raw.h>
#include <lwip/tcpip.h>
#if CHIP_HAVE_CONFIG_H
#include <lwip/lwip_buildconfig.h>
#endif // CHIP_HAVE_CONFIG_H
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/lwip_buildconfig.h> // nogncheck
#endif // CHIP_HAVE_CONFIG_H
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <system/SystemSockets.h>
Expand Down
6 changes: 3 additions & 3 deletions src/inet/UDPEndPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
#include <lwip/tcpip.h>
#include <lwip/udp.h>
#if CHIP_HAVE_CONFIG_H
#include <lwip/lwip_buildconfig.h>
#endif // CHIP_HAVE_CONFIG_H
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/lwip_buildconfig.h> // nogncheck
#endif // CHIP_HAVE_CONFIG_H
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#if HAVE_SYS_SOCKET_H
Expand Down

0 comments on commit 2159776

Please sign in to comment.