blob: 990c8e1c1211b7f7a66727ab78550ba1c00bc155 [file] [log] [blame]
# Copyright 2022 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")
rustc_binary("bin") {
edition = "2021"
output_name = "bt_peripheral_hub"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.bluetooth.power:fuchsia.bluetooth.power_rust",
"//sdk/fidl/fuchsia.power.battery:fuchsia.power.battery_rust",
"//src/connectivity/bluetooth/lib/fuchsia-bluetooth",
"//src/lib/async-utils",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//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:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//src/connectivity/bluetooth/lib/async-helpers:async-test-helpers",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:assert_matches",
]
sources = [
"src/error.rs",
"src/fidl_service.rs",
"src/main.rs",
"src/peripheral_state.rs",
"src/reporter.rs",
"src/watcher.rs",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("component") {
component_name = "bt-peripheral-hub"
manifest = "meta/bt-peripheral-hub.cml"
deps = [ ":bin" ]
}
fuchsia_package("bt-peripheral-hub") {
deps = [ ":component" ]
}
fuchsia_unittest_package("bt-peripheral-hub-tests") {
deps = [ ":bin_test" ]
}
group("tests") {
testonly = true
deps = [ ":bt-peripheral-hub-tests" ]
}