| # Copyright 2023 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/assembly/bootfs_files_for_assembly.gni") |
| import("//build/dist/renamed_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| # `component` is conceptually a binary, but it is built as a lib here so it can be |
| # aggregated into //src/sys/tools/shared-multi-call-tool-binary to save disk space. |
| rustc_library("component") { |
| visibility = [ |
| ":*", |
| "../shared-multi-call-tool-binary:*", |
| ] |
| edition = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.dash:fuchsia.dash_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-url", |
| "//src/sys/lib/component_debug", |
| "//src/sys/lib/moniker", |
| "//src/sys/lib/socket-to-stdio", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| ] |
| |
| # The component tool is only used for debugging. |
| deps += [ "//build/validate:non_production_tag" ] |
| |
| # This is a part of the bootfs image, so attempt to minimize its size impact. |
| configs += [ "//build/config/rust:bootfs" ] |
| |
| sources = [ |
| "src/args.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| renamed_binary("component-binary") { |
| source = "$root_out_dir/shared-multi-call-tool-binary" |
| source_deps = [ "//src/sys/tools/shared-multi-call-tool-binary" ] |
| dest = "bin/component" |
| } |
| |
| bootfs_files_for_assembly("bootfs") { |
| deps = [ ":component-binary" ] |
| } |