blob: 7fb54d8060accecf7aa8d464d272d786d12d6061 [file] [log] [blame]
# Copyright 2017 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/components.gni")
import("//build/rust/rustc_binary.gni")
import("//src/sys/core/build/core_shard.gni")
import("//third_party/cobalt/metrics_registry.gni")
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
# We don't need to include a copy of our projects's Cobalt registry in our package because we
# rely on it being packaged with Cobalt itself
generate_binarypb = false
}
rustc_binary("bin") {
name = "wlanstack"
with_unit_tests = true
edition = "2018"
deps = [
":wlan_metrics_registry_rustlib",
":wlanstack_config",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.cobalt:fuchsia.cobalt-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics-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.mesh:fuchsia.wlan.mesh-rustc",
"//sdk/fidl/fuchsia.wlan.minstrel:fuchsia.wlan.minstrel-rustc",
"//sdk/fidl/fuchsia.wlan.mlme:fuchsia.wlan.mlme-rustc",
"//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme-rustc",
"//sdk/fidl/fuchsia.wlan.stats:fuchsia.wlan.stats-rustc",
"//sdk/fidl/fuchsia.wlan.tap:fuchsia.wlan.tap-rustc",
"//src/connectivity/wlan/lib/common/rust/:wlan-common",
"//src/connectivity/wlan/lib/eapol",
"//src/connectivity/wlan/lib/ieee80211",
"//src/connectivity/wlan/lib/inspect:wlan-inspect",
"//src/connectivity/wlan/lib/rsn:wlan-rsn",
"//src/connectivity/wlan/lib/sme:wlan-sme",
"//src/connectivity/wlan/lib/wlan_dev",
"//src/diagnostics/persistence/fidl:persist-rustc",
"//src/lib/cobalt/rust:fuchsia-cobalt",
"//src/lib/diagnostics/inspect/contrib/rust",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/storage/fuchsia-vfs-watcher",
"//src/lib/syslog/rust:syslog",
"//src/lib/zerocopy",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//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:paste",
"//third_party/rust_crates:pin-utils",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:void",
]
test_deps = [
"//src/connectivity/wlan/testing/wlantap-client",
"//third_party/rust_crates:test-case",
]
sources = [
"src/device.rs",
"src/future_util.rs",
"src/inspect.rs",
"src/main.rs",
"src/service.rs",
"src/test_helper.rs",
]
}
# TODO(91927): fuchsia_component_manifest will soon be unnecessary and can folded into the component
fuchsia_component_manifest("wlanstack-manifest") {
component_name = "wlanstack"
manifest = "meta/wlanstack.cml"
}
fuchsia_component("wlanstack-comp") {
cm_label = ":wlanstack-manifest"
deps = [
":bin",
":wlan_metrics_registry",
]
}
fuchsia_structured_config_values("wlanstack-values") {
cm_label = ":wlanstack-manifest"
values = {
wep_supported = false
wpa1_supported = false
}
}
fuchsia_structured_config_values("wlanstack-legacy-privacy-values") {
cm_label = ":wlanstack-manifest"
values = {
wep_supported = true
wpa1_supported = true
}
}
fuchsia_structured_config_rust_lib("wlanstack_config") {
cm_label = ":wlanstack-manifest"
}
fuchsia_package("wlanstack") {
deps = [
":wlanstack-comp",
":wlanstack-values",
]
}
fuchsia_package("wlanstack-legacy-privacy") {
package_name = "wlanstack"
deps = [
":wlanstack-comp",
":wlanstack-legacy-privacy-values",
]
}
core_shard("wlanstack-core-shard") {
shard_file = "meta/wlanstack.core_shard.cml"
}
core_shard("wlanstack-legacy-privacy-core-shard") {
shard_file = "meta/wlanstack_legacy_privacy.core_shard.cml"
}
fuchsia_unittest_package("wlanstack-tests") {
deps = [ ":bin_test" ]
}