| # Copyright 2018 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") |
| |
| rustc_binary("bin") { |
| name = "bt_init" |
| edition = "2021" |
| source_root = "src/main.rs" |
| with_unit_tests = true |
| |
| deps = [ |
| ":bt_init_config", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.snoop:fuchsia.bluetooth.snoop_rust", |
| "//sdk/fidl/fuchsia.bluetooth.sys:fuchsia.bluetooth.sys_rust", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "bt-init" |
| manifest = "meta/bt-init.cml" |
| } |
| |
| fuchsia_structured_config_rust_lib("bt_init_config") { |
| cm_label = ":manifest" |
| } |
| |
| fuchsia_structured_config_values("default_config_values") { |
| cm_label = ":manifest" |
| values = { |
| autostart_snoop = true |
| } |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("bt-init") { |
| deps = [ |
| ":component", |
| ":default_config_values", |
| ] |
| subpackages = [ "//src/connectivity/bluetooth/core/bt-host" ] |
| } |
| |
| fuchsia_component("testonly_component") { |
| manifest = "meta/bt-init-testonly.cml" |
| component_name = "bt-init-testonly" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("bt-init-testonly") { |
| deps = [ |
| ":default_config_values", |
| ":testonly_component", |
| ] |
| } |
| |
| fuchsia_unittest_package("tests") { |
| component_name = "bt-init-unittests" |
| package_name = "bt-init-unittests" |
| |
| deps = [ |
| ":bin_test", |
| ":default_config_values", |
| ] |
| } |