| # 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-rustc", |
| "//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network-rustc", |
| "//sdk/fidl/fuchsia.hwinfo:fuchsia.hwinfo-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.location.namedplace:fuchsia.location.namedplace-rustc", |
| "//sdk/fidl/fuchsia.lowpan:fuchsia.lowpan-rustc", |
| "//sdk/fidl/fuchsia.lowpan.device:fuchsia.lowpan.device-rustc", |
| "//sdk/fidl/fuchsia.lowpan.driver:fuchsia.lowpan.driver-rustc", |
| "//sdk/fidl/fuchsia.lowpan.spinel:fuchsia.lowpan.spinel-rustc", |
| "//sdk/fidl/fuchsia.lowpan.test:fuchsia.lowpan.test-rustc", |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces-rustc", |
| "//sdk/fidl/fuchsia.net.mdns:fuchsia.net.mdns-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//sdk/fidl/fuchsia.net.tun:fuchsia.net.tun-rustc", |
| "//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/connectivity/lowpan/lib/openthread_sys", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/network/packet", |
| "//src/lib/syslog/rust:syslog", |
| "//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:derivative", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:slab", |
| "//third_party/rust_crates:static_assertions", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "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/driver_state.rs", |
| "src/driver/error_adapter.rs", |
| "src/driver/host_to_thread.rs", |
| "src/driver/joiner.rs", |
| "src/driver/mod.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" ] |
| } |
| |
| fuchsia_component("lowpan-ot-driver-cv2") { |
| component_name = "lowpan-ot-driver" |
| deps = [ ":bin" ] |
| manifest = "meta/lowpan-ot-driver.cml" |
| } |
| |
| fuchsia_component("lowpan-ot-driver-cv1") { |
| component_name = "lowpan-ot-driver" |
| deps = [ ":bin" ] |
| manifest = "meta/lowpan-ot-driver.cmx" |
| } |
| |
| fuchsia_package("lowpan-ot-driver") { |
| deps = [ |
| ":lowpan-ot-driver-cv1", |
| ":lowpan-ot-driver-cv2", |
| ] |
| } |
| |
| 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" ] # fxbug.dev/92419 |
| }, |
| ] |
| } |
| } |
| |
| 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" |
| } |