| # 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/host.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| if (is_host) { |
| rustc_binary("package-tool") { |
| version = "0.1.0" |
| edition = "2021" |
| with_unit_tests = true |
| deps = [ |
| "//src/lib/fuchsia", |
| "//src/sys/pkg/lib/package-tool", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| |
| # Avoid instrumenting this target as it has a large negative impact on performance. |
| exclude_toolchain_tags = [ |
| "asan", |
| "coverage", |
| "profile", |
| ] |
| } |
| |
| install_host_tools("host") { |
| deps = [ ":package-tool" ] |
| outputs = [ "package-tool" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":package-tool_test($host_toolchain)" ] |
| } |
| } else { |
| group("package-tool") { |
| deps = [ ":package-tool($host_toolchain)" ] |
| } |
| |
| group("host") { |
| deps = [ ":host($host_toolchain)" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":tests($host_toolchain)" ] |
| } |
| } |