| # 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/package.gni") |
| import("//build/rust/rustc_binary.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/fidl/fuchsia.wlan.mlme:fuchsia.wlan.mlme-rustc", |
| "//garnet/public/fidl/fuchsia.wlan.service:fuchsia.wlan.service-rustc", |
| "//garnet/public/fidl/fuchsia.wlan.stats:fuchsia.wlan.stats-rustc", |
| "//garnet/public/lib/fidl/rust/fidl", |
| "//garnet/public/rust/fuchsia-app", |
| "//garnet/public/rust/fuchsia-async", |
| "//garnet/public/rust/fuchsia-zircon", |
| "//third_party/rust-crates/rustc_deps:failure", |
| "//third_party/rust-crates/rustc_deps:futures-preview", |
| "//third_party/rust-crates/rustc_deps:log", |
| "//third_party/rust-crates/rustc_deps:parking_lot", |
| "//third_party/rust-crates/rustc_deps:pin-utils", |
| "//third_party/rust-crates/rustc_deps:serde", |
| "//third_party/rust-crates/rustc_deps:serde_derive", |
| "//third_party/rust-crates/rustc_deps:serde_json", |
| "//third_party/rust-crates/rustc_deps:tempfile", |
| ] |
| } |
| |
| package("wlancfg") { |
| deps = [ |
| ":bin", |
| ] |
| |
| binary = "rust_crates/wlancfg" |
| |
| meta = [ |
| { |
| path = rebase_path("meta/wlancfg.cmx") |
| dest = "wlancfg.cmx" |
| }, |
| ] |
| } |
| |
| package("config") { |
| deprecated_system_image = true |
| |
| if (wlancfg_config_type == "ap") { |
| resources = [ |
| { |
| path = rebase_path("config/ap.json") |
| dest = "wlan/default.json" |
| }, |
| ] |
| } else if (wlancfg_config_type == "client") { |
| resources = [ |
| { |
| path = rebase_path("config/client.json") |
| dest = "wlan/default.json" |
| }, |
| ] |
| } |
| } |
| |
| package("wlancfg-tests") { |
| testonly = true |
| deps = [ |
| ":bin", |
| ] |
| tests = [ |
| { |
| name = "wlancfg_bin_test_rustc" |
| dest = "wlancfg_bin_test_rustc" |
| }, |
| ] |
| } |