blob: b5e3d13657b4c558d89d6db4c05bc2ec2dee8707 [file] [log] [blame]
# Copyright 2017 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("make-fuchsia-vol") {
edition = "2021"
sources = [ "src/main.rs" ]
data_deps = [
"//src/storage/bin/fvm",
"//zircon/third_party/uapp/mkfs-msdosfs",
]
deps = [
"//build/sdk/meta:rust",
"//src/lib/assembly/partitions_config",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:camino",
"//third_party/rust_crates:crc",
"//third_party/rust_crates:fatfs",
"//third_party/rust_crates:gpt",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:rand_xorshift",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:uuid",
"//third_party/rust_crates:zerocopy_0_0_0_alpha_0",
]
with_unit_tests = true
test_deps = [
":test_bin",
":test_data",
"//third_party/rust_crates:camino",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:zstd",
"//third_party/zstd",
]
}
host_test_data("test_data") {
sources = [
"test_data/golden",
"test_data/images.json",
"test_data/product_bundle.json",
]
outputs =
[ "$root_out_dir/make-fuchsia-vol_test_data/{{source_file_part}}" ]
}
host_test_data("test_bin") {
sources = [ "$root_out_dir/mkfs-msdosfs" ]
outputs =
[ "$root_out_dir/make-fuchsia-vol_test_data/host_x64/mkfs-msdosfs" ]
deps = [ "//zircon/third_party/uapp/mkfs-msdosfs" ]
}
}
install_host_tools("host") {
deps = [ ":make-fuchsia-vol($host_toolchain)" ]
outputs = [ "make-fuchsia-vol" ]
}
group("tests") {
testonly = true
deps = [ ":make-fuchsia-vol_test($host_toolchain)" ]
}