blob: bdb690586195a49ea173b0d10bde6842d1dc253d [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 = [
"//garnet/lib/wlan/fidl:fidl-rustc",
"//garnet/lib/wlan/fidl:service-rustc",
"//garnet/lib/wlan/fidl:sme-rustc",
"//garnet/public/lib/fidl/rust/fidl",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-component",
"//garnet/public/rust/fuchsia-zircon",
"//sdk/fidl/fuchsia.wlan.ap:fuchsia.wlan.ap.policy-rustc",
"//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common-rustc",
"//sdk/fidl/fuchsia.wlan.policy:fuchsia.wlan.policy-rustc",
"//sdk/fidl/fuchsia.wlan.service:fuchsia.wlan.service-rustc",
"//sdk/fidl/fuchsia.wlan.stats:fuchsia.wlan.stats-rustc",
"//third_party/rust_crates:failure",
"//third_party/rust_crates:futures-preview",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:log",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:pin-utils",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_derive",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
"//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",
]
tests = [
{
name = "wlancfg_bin_test"
dest = "wlancfg_bin_test"
environments = basic_envs
},
]
}