blob: fcd4c4524e7bc35f39530f87564921f10014d367 [file] [log] [blame]
# Copyright 2021 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_library.gni")
import("//third_party/openthread/openthread_upstream_version.gni")
config("openthread_240214") {
rustflags = [ "--cfg=openthread_240214" ]
}
rustc_library("openthread_fuchsia") {
edition = "2021"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.net:fuchsia.net_rust",
"//sdk/fidl/fuchsia.net.mdns:fuchsia.net.mdns_rust",
"//sdk/fidl/fuchsia.net.name:fuchsia.net.name_rust",
"//src/connectivity/lowpan/lib/lowpan_driver_common",
"//src/connectivity/lowpan/lib/openthread_rust:openthread",
"//src/connectivity/lowpan/lib/openthread_sys",
"//src/connectivity/lowpan/lib/spinel_pack",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-sync",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:socket2",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
sources = [
"src/backing/alarm.rs",
"src/backing/infra_if.rs",
"src/backing/mod.rs",
"src/backing/nat64.rs",
"src/backing/radio.rs",
"src/backing/reset.rs",
"src/backing/resolver.rs",
"src/backing/trel.rs",
"src/backing/udp.rs",
"src/binding.rs",
"src/lib.rs",
"src/logging.rs",
"src/to_escaped_string.rs",
]
non_rust_deps =
[ "//src/connectivity/openthread/third_party/openthread/platform" ]
if (openthread_upstream_version ==
"49c59ec519cc8b49dd58978d1bc80b7ae7ba88d0") {
configs += [ ":openthread_240214" ]
}
configs += [ "//build/config/fuchsia:static_cpp_standard_library" ]
configs += [ "//build/config/rust/lints:clippy_warn_all" ]
}
fuchsia_unittest_package("openthread-fuchsia-tests") {
deps = [ ":openthread_fuchsia_test" ]
}
group("tests") {
testonly = true
deps = [ ":openthread-fuchsia-tests" ]
}