Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow building CHIP without lwip checked out #2683

Merged
merged 2 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/src/lwip/lwip.gni")

config("includes") {
include_dirs = [
Expand Down Expand Up @@ -46,11 +47,12 @@ if (chip_build_tests) {
"${chip_root}/src/transport/tests",
]

if (chip_with_lwip) {
deps += [ "${chip_root}/src/lwip/tests" ]
}

if (current_os != "zephyr") {
deps += [
"${chip_root}/src/lib/shell/tests",
"${chip_root}/src/lwip/tests",
]
deps += [ "${chip_root}/src/lib/shell/tests" ]
}
}
}
6 changes: 5 additions & 1 deletion src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import("//build_overrides/nlio.gni")

import("${chip_root}/gn/chip/buildconfig_header.gni")
import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/src/lwip/lwip.gni")
import("${chip_root}/src/platform/device.gni")
import("inet.gni")

Expand Down Expand Up @@ -97,11 +98,14 @@ static_library("inet") {
public_deps = [
":inet_config_header",
"${chip_root}/src/lib/support",
"${chip_root}/src/lwip",
"${chip_root}/src/system",
"${nlio_root}:nlio",
]

if (chip_with_lwip) {
public_deps += [ "${chip_root}/src/lwip" ]
}

if (chip_inet_config_enable_raw_endpoint) {
sources += [
"RawEndPoint.cpp",
Expand Down
3 changes: 3 additions & 0 deletions src/lwip/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ import("//build_overrides/chip.gni")
import("//build_overrides/lwip.gni")

import("${chip_root}/gn/chip/buildconfig_header.gni")
import("${chip_root}/src/lwip/lwip.gni")
import("${lwip_root}/lwip.gni")

assert(chip_with_lwip)

declare_args() {
# lwIP platform: standalone, freertos.
lwip_platform = ""
Expand Down
18 changes: 18 additions & 0 deletions src/lwip/lwip.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Have the the lwIP library available.
mspang marked this conversation as resolved.
Show resolved Hide resolved
chip_with_lwip = current_os != "zephyr"
}
3 changes: 2 additions & 1 deletion src/lwip/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/chip_test.gni")
import("${chip_root}/gn/chip/chip_test_group.gni")
import("${chip_root}/src/lwip/lwip.gni")

assert(current_os != "zephyr")
assert(chip_with_lwip)

chip_test("TestLwIP") {
sources = [ "tests.c" ]
Expand Down
6 changes: 5 additions & 1 deletion src/system/system.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")

import("${chip_root}/src/lwip/lwip.gni")

declare_args() {
# Use the lwIP library.
chip_system_config_use_lwip = current_os == "freertos"
chip_system_config_use_lwip = chip_with_lwip && current_os == "freertos"

# Use BSD/POSIX socket API.
chip_system_config_use_sockets = current_os != "freertos"
Expand Down