blob: fab6b798504268eca97e8beae10fd4b014fe447d [file] [log] [blame]
# 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/host.gni")
import("//build/rust/rustc_binary.gni")
import("//src/sys/build/components.gni")
rustc_binary("bin") {
name = "odu"
version = "0.1.0"
with_unit_tests = true
edition = "2018"
deps = [
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:clap",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:log",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/args.rs",
"src/common_operations.rs",
"src/file_target.rs",
"src/generator.rs",
"src/io_packet.rs",
"src/issuer.rs",
"src/log.rs",
"src/main.rs",
"src/operations.rs",
"src/sequential_io_generator.rs",
"src/target.rs",
"src/verifier.rs",
]
if (is_fuchsia) {
sources += [ "src/fuchsia_utils.rs" ]
deps += [
"//src/lib/cstr",
"//src/lib/trace/rust:trace",
"//src/lib/trace/rust:trace-provider",
]
} else {
sources += [ "src/not_fuchsia_utils.rs" ]
}
}
fuchsia_shell_package("odu") {
manifest = "meta/odu.cmx"
deps = [ ":bin" ]
}
fuchsia_unittest_package("odu_tests") {
manifest = "meta/odu_bin_test.cmx"
deps = [ ":bin_test" ]
}
install_host_tools("odu_host") {
deps = [ ":bin($host_toolchain)" ]
outputs = [ "odu" ]
}
group("tests") {
testonly = true
deps = [
":bin_test($host_toolchain)",
":odu_tests",
]
}