Skip to content

Commit

Permalink
Spell out inet and lwip sources in GN (#31931)
Browse files Browse the repository at this point in the history
* Spell out inet and lwip sources

Prepare to have some scripts that force all headers/sources to be known to GN.

* Fix some copy and paste issues

* Another copy and paste issue fixed

* Restyle
  • Loading branch information
andy31415 authored and pull[bot] committed Mar 5, 2024
1 parent a941ed6 commit 6c45909
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 40 deletions.
34 changes: 34 additions & 0 deletions src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,20 @@ source_set("inet_config_header") {
deps = [ ":inet_buildconfig" ]
}

source_set("impl_header") {
sources = [ "InetInterfaceImpl.h" ]
public_configs = [ "${chip_root}/src:includes" ]
public_deps = [ "${chip_root}/src/system:system_config_header" ]
}

static_library("inet") {
output_name = "libInetLayer"

# EndpointState header is one of:
# - src/inet/EndPointStateLwIP.h
# - src/inet/EndPointStateNetworkFramework.h
# - src/inet/EndPointStateOpenThread.h
# - src/inet/EndPointStateSockets.h
sources = [
"EndPointBasis.h",
"EndPointState${chip_system_config_inet}.h",
Expand All @@ -98,6 +109,7 @@ static_library("inet") {
]

public_deps = [
":impl_header",
":inet_config_header",
"${chip_root}/src/lib/core:types",
"${chip_root}/src/lib/support",
Expand All @@ -115,6 +127,13 @@ static_library("inet") {
}

if (chip_inet_config_enable_tcp_endpoint) {
# Possible TCPEndpointImpl files:
# - TCPEndPointImplLwIP.cpp
# - TCPEndPointImplLwIP.h
# - TCPEndPointImplOpenThread.cpp
# - TCPEndPointImplOpenThread.h
# - TCPEndPointImplSockets.cpp
# - TCPEndPointImplSockets.h
sources += [
"TCPEndPoint.cpp",
"TCPEndPoint.h",
Expand All @@ -125,6 +144,15 @@ static_library("inet") {
}

if (chip_inet_config_enable_udp_endpoint) {
# Possible UDPEndpointImpl files:
# - UDPEndPointImplLwIP.cpp
# - UDPEndPointImplLwIP.h
# - UDPEndPointImplNetworkFramework.cpp
# - UDPEndPointImplNetworkFramework.h
# - UDPEndPointImplOpenThread.cpp
# - UDPEndPointImplOpenThread.h
# - UDPEndPointImplSockets.cpp
# - UDPEndPointImplSockets.h
sources += [
"BasicPacketFilters.h",
"EndpointQueueFilter.h",
Expand All @@ -134,6 +162,12 @@ static_library("inet") {
"UDPEndPointImpl${chip_system_config_inet}.h",
"UDPEndPointImpl.h",
]

if (chip_system_config_inet == "Sockets") {
# TODO: dependency on this one is not clear as it is only ever
# enabled through CMakeLists.txt. Added here for completeness
sources += [ "ZephyrSocket.h" ]
}
}

if (chip_with_nlfaultinjection) {
Expand Down
39 changes: 0 additions & 39 deletions src/inet/tests/TestInetLayer.h

This file was deleted.

5 changes: 4 additions & 1 deletion src/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ static_library("android") {

source_set("inet") {
sources = [ "InetInterfaceImpl.cpp" ]
deps = [ "${chip_root}/src/lib/support" ]
deps = [
"${chip_root}/src/inet:impl_header",
"${chip_root}/src/lib/support",
]
}

android_library("java") {
Expand Down
6 changes: 6 additions & 0 deletions src/system/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ static_library("system") {
]

if (chip_system_layer_impl_config_file == "") {
# This includes one of:
# - SystemLayerImplFreeRTOS.h
# - SystemLayerImplFreeRTOS.cpp
# or
# - SystemLayerImplSelect.h
# - SystemLayerImplSelect.cpp
sources += [
"SystemLayerImpl${chip_system_config_event_loop}.cpp",
"SystemLayerImpl${chip_system_config_event_loop}.h",
Expand Down

0 comments on commit 6c45909

Please sign in to comment.