| # Copyright 2019 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/config.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| rustc_binary("bin") { |
| output_name = "lowpan_ot_driver" |
| with_unit_tests = true |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.factory.lowpan:fuchsia.factory.lowpan_rust", |
| "//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network_rust", |
| "//sdk/fidl/fuchsia.hwinfo:fuchsia.hwinfo_rust", |
| "//sdk/fidl/fuchsia.location.namedplace:fuchsia.location.namedplace_rust", |
| "//sdk/fidl/fuchsia.lowpan.bootstrap:fuchsia.lowpan.bootstrap_rust", |
| "//sdk/fidl/fuchsia.lowpan.device:fuchsia.lowpan.device_rust", |
| "//sdk/fidl/fuchsia.lowpan.driver:fuchsia.lowpan.driver_rust", |
| "//sdk/fidl/fuchsia.lowpan.experimental:fuchsia.lowpan.experimental_rust", |
| "//sdk/fidl/fuchsia.lowpan.spinel:fuchsia.lowpan.spinel_rust", |
| "//sdk/fidl/fuchsia.net:fuchsia.net_rust", |
| "//sdk/fidl/fuchsia.net.dhcpv6:fuchsia.net.dhcpv6_rust", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust", |
| "//sdk/fidl/fuchsia.net.masquerade:fuchsia.net.masquerade_rust", |
| "//sdk/fidl/fuchsia.net.mdns:fuchsia.net.mdns_rust", |
| "//sdk/fidl/fuchsia.net.multicast.admin:fuchsia.net.multicast.admin_rust", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack_rust", |
| "//src/connectivity/lib/fidl_fuchsia_net_stack_ext", |
| "//src/connectivity/lib/net-declare", |
| "//src/connectivity/lib/net-types", |
| "//src/connectivity/lib/packet-formats", |
| "//src/connectivity/lowpan/lib/lowpan_driver_common", |
| "//src/connectivity/lowpan/lib/openthread_fuchsia", |
| "//src/connectivity/lowpan/lib/openthread_rust:openthread", |
| "//src/lib/diagnostics/log/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-sync", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/network/packet", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:bitflags", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:lazy_static", |
| ] |
| |
| sources = [ |
| "src/bootstrap.rs", |
| "src/config.rs", |
| "src/convert_ext.rs", |
| "src/driver/api.rs", |
| "src/driver/border_agent.rs", |
| "src/driver/connectivity_state.rs", |
| "src/driver/convert.rs", |
| "src/driver/detailed_logging.rs", |
| "src/driver/dhcpv6pd.rs", |
| "src/driver/driver_state.rs", |
| "src/driver/error_adapter.rs", |
| "src/driver/host_to_thread.rs", |
| "src/driver/joiner.rs", |
| "src/driver/mod.rs", |
| "src/driver/multicast_routing_manager.rs", |
| "src/driver/nat64.rs", |
| "src/driver/ot_ctl.rs", |
| "src/driver/srp_proxy/advertising_proxy.rs", |
| "src/driver/srp_proxy/discovery_proxy.rs", |
| "src/driver/srp_proxy/mod.rs", |
| "src/driver/tasks.rs", |
| "src/driver/tests.rs", |
| "src/driver/thread_to_host.rs", |
| "src/main.rs", |
| ] |
| |
| non_rust_deps = |
| [ "//src/connectivity/openthread/third_party/openthread/platform" ] |
| configs += [ "//build/config/fuchsia:static_cpp_standard_library" ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_component("lowpan-ot-driver-cv2") { |
| component_name = "lowpan-ot-driver" |
| deps = [ ":bin" ] |
| manifest = "meta/lowpan-ot-driver.cml" |
| } |
| |
| fuchsia_package("lowpan-ot-driver") { |
| deps = [ |
| ":lowpan-ot-driver-cv2", |
| "//src/connectivity/lowpan/monitor:lowpan-monitor", |
| ] |
| } |
| |
| fuchsia_unittest_package("lowpan-ot-driver-test") { |
| manifest = "meta/lowpan-ot-driver-test.cml" |
| deps = [ ":bin_test" ] |
| test_specs = { |
| environments = [ |
| { |
| dimensions = { |
| device_type = "QEMU" |
| } |
| tags = [ "flaky" ] # https://fxbug.dev/42174091 |
| }, |
| ] |
| } |
| } |
| |
| config_data("config-default") { |
| for_pkg = "lowpan-ot-driver" |
| sources = [ "config/device_config.json" ] |
| outputs = [ "device_config.json" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":lowpan-ot-driver-test" ] |
| } |
| |
| core_shard("lowpan_ot_driver_core_shard") { |
| shard_file = "meta/lowpan-ot-driver.core_shard.cml" |
| } |