blob: 37f1cb82dc1d80a4e47a035f2c0e87b66d9349f9 [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/rust/rustc_binary.gni")
if (is_host) {
config("env") {
rustenv = [ "RUST_SYSROOT=$out_rustc_prefix" ]
}
rustc_binary("shush") {
edition = "2021"
with_unit_tests = true
deps = [
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:proc-macro2",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:rustfix",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:syn",
]
sources = [
"src/allow.rs",
"src/fix.rs",
"src/lint.rs",
"src/main.rs",
"src/owners.rs",
"src/span.rs",
]
# Specify clippy-driver path from our prebuilts for tests
test_deps = [ "//build/rust:prebuilt_toolchain_host_test_data" ]
# TODO(josephry): update this to just use rustenv after http://fxrev.dev/667908 lands
configs += [ ":env" ]
}
copy("install") {
sources = [ "$root_out_dir/shush" ]
deps = [ ":shush" ]
outputs = [ "$root_build_dir/host-tools/{{source_file_part}}" ]
}
}