blob: d65a2dd79aa10cc25115981483d9b3747b18457a [file] [log] [blame]
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config.gni")
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
declare_args() {
# Selects the wlan configuration type to use. Choices:
# "client" - client mode
# "ap" - access point mode
# "" (empty string) - no configuration
wlancfg_config_type = "client"
}
rustc_binary("bin") {
name = "wlancfg"
with_unit_tests = true
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc",
"//sdk/fidl/fuchsia.wlan.ap:fuchsia.wlan.ap.policy-rustc",
"//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common-rustc",
"//sdk/fidl/fuchsia.wlan.device:fuchsia.wlan.device-rustc",
"//sdk/fidl/fuchsia.wlan.device.service:fuchsia.wlan.device.service-rustc",
"//sdk/fidl/fuchsia.wlan.policy:fuchsia.wlan.policy-rustc",
"//sdk/fidl/fuchsia.wlan.service:fuchsia.wlan.service-rustc",
"//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme-rustc",
"//sdk/fidl/fuchsia.wlan.stats:fuchsia.wlan.stats-rustc",
"//src/connectivity/wlan/lib/common/rust/:wlan-common",
"//src/connectivity/wlan/lib/stash/:wlan-stash",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:base64",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:log",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:pin-utils",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:void",
]
}
package("wlancfg") {
deps = [ ":bin" ]
binaries = [
{
path = "wlancfg"
name = "wlancfg"
},
]
meta = [
{
path = rebase_path("meta/wlancfg.cmx")
dest = "wlancfg.cmx"
},
]
}
config_data("config") {
for_pkg = "wlancfg"
if (wlancfg_config_type == "ap") {
sources = [ rebase_path("config/ap.json") ]
outputs = [ "default.json" ]
} else if (wlancfg_config_type == "client") {
sources = [ rebase_path("config/client.json") ]
outputs = [ "default.json" ]
}
}
test_package("wlancfg-tests") {
deps = [
":bin_test",
"//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc",
]
tests = [
{
name = "wlancfg_bin_test"
dest = "wlancfg_bin_test"
environments = basic_envs
},
]
}