blob: a0510ae09ba28d38bdca1571e03e35618dc06bca [file] [log] [blame]
# Copyright 2020 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_rfcomm"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth_rust",
"//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust",
"//sdk/fidl/fuchsia.bluetooth.rfcomm.test:fuchsia.bluetooth.rfcomm.test_rust",
"//src/connectivity/bluetooth/lib/bt-rfcomm",
"//src/connectivity/bluetooth/lib/fuchsia-bluetooth",
"//src/connectivity/bluetooth/lib/packet-encoding",
"//src/lib/async-utils",
"//src/lib/diagnostics/inspect/derive",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:slab",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//src/connectivity/bluetooth/lib/async-helpers:async-test-helpers",
"//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:assert_matches",
]
sources = [
"src/fidl_service.rs",
"src/main.rs",
"src/profile.rs",
"src/profile_registrar.rs",
"src/rfcomm/inspect.rs",
"src/rfcomm/mod.rs",
"src/rfcomm/server.rs",
"src/rfcomm/session/channel.rs",
"src/rfcomm/session/mod.rs",
"src/rfcomm/session/multiplexer.rs",
"src/rfcomm/test_util.rs",
"src/rfcomm/types.rs",
"src/types.rs",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("component") {
component_name = "bt-rfcomm"
manifest = "meta/bt-rfcomm.cml"
deps = [ ":bin" ]
}
fuchsia_package("bt-rfcomm") {
deps = [ ":component" ]
}
fuchsia_package_with_single_component("bt-rfcomm-testonly") {
deps = [ ":bin" ]
manifest = "meta/bt-rfcomm-testonly.cml"
}
fuchsia_unittest_package("bt-rfcomm-tests") {
deps = [ ":bin_test" ]
}
group("tests") {
testonly = true
deps = [ ":bt-rfcomm-tests" ]
}