| # 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/rust/rustc_binary.gni") |
| import("//build/testing/environments.gni") |
| import("//src/sys/build/components.gni") |
| import("//third_party/cobalt/metrics_registry.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 = [ |
| ":wlan_metrics_registry_rustlib", |
| "//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-rustc", |
| "//sdk/fidl/fuchsia.location.namedplace:fuchsia.location.namedplace-rustc", |
| "//sdk/fidl/fuchsia.location.sensor:fuchsia.location.sensor-rustc", |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-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.ieee80211:fuchsia.wlan.ieee80211-rustc", |
| "//sdk/fidl/fuchsia.wlan.internal:fuchsia.wlan.internal-rustc", |
| "//sdk/fidl/fuchsia.wlan.policy:fuchsia.wlan.policy-rustc", |
| "//sdk/fidl/fuchsia.wlan.product.deprecatedclient:fuchsia.wlan.product.deprecatedclient-rustc", |
| "//sdk/fidl/fuchsia.wlan.product.deprecatedconfiguration:fuchsia.wlan.product.deprecatedconfiguration-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/inspect:wlan-inspect", |
| "//src/connectivity/wlan/lib/stash/:wlan-stash", |
| "//src/lib/cobalt/rust:fuchsia-cobalt", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//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/cobalt/src/lib/client/rust:cobalt-client", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:base64", |
| "//third_party/rust_crates:eui48", |
| "//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:rand", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:test-case", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:void", |
| ] |
| |
| sources = [ |
| "src/access_point/mod.rs", |
| "src/access_point/state_machine.rs", |
| "src/access_point/types.rs", |
| "src/client/mod.rs", |
| "src/client/network_selection.rs", |
| "src/client/scan.rs", |
| "src/client/state_machine.rs", |
| "src/client/types.rs", |
| "src/config_management/config_manager.rs", |
| "src/config_management/mod.rs", |
| "src/config_management/network_config.rs", |
| "src/config_management/stash_conversion.rs", |
| "src/legacy/deprecated_client.rs", |
| "src/legacy/deprecated_configuration.rs", |
| "src/legacy/device.rs", |
| "src/legacy/known_ess_store.rs", |
| "src/legacy/mod.rs", |
| "src/main.rs", |
| "src/mode_management/iface_manager.rs", |
| "src/mode_management/iface_manager_api.rs", |
| "src/mode_management/iface_manager_types.rs", |
| "src/mode_management/mod.rs", |
| "src/mode_management/phy_manager.rs", |
| "src/regulatory_manager.rs", |
| "src/util/fuse_pending.rs", |
| "src/util/future_with_metadata.rs", |
| "src/util/listener/access_point.rs", |
| "src/util/listener/client.rs", |
| "src/util/listener/generic.rs", |
| "src/util/listener/mod.rs", |
| "src/util/logger.rs", |
| "src/util/mod.rs", |
| "src/util/sme_conversion.rs", |
| "src/util/state_machine.rs", |
| "src/util/testing/cobalt.rs", |
| "src/util/testing/generate_struct.rs", |
| "src/util/testing/mod.rs", |
| "src/util/testing/sme_stream.rs", |
| ] |
| } |
| |
| fuchsia_component("service") { |
| component_name = "wlancfg" |
| manifest = "meta/wlancfg.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("wlancfg") { |
| deps = [ ":service" ] |
| } |
| |
| 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" ] |
| } |
| } |
| |
| fuchsia_unittest_package("wlancfg-tests") { |
| manifest = "meta/wlancfg_bin_test.cmx" |
| deps = [ ":bin_test" ] |
| } |
| |
| metrics_registry("wlan_metrics_registry") { |
| # This must match the ID of our Cobalt project as specified in: |
| # //third_party/cobalt_config/projects.yaml |
| project_id = 3708719327 |
| generate_rust = true # Generates a rust target with '_rustlib' appended |
| } |