| # 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/components.gni") |
| import("//build/host.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_staticlib.gni") |
| |
| odu_sources = [ |
| "src/args.rs", |
| "src/common_operations.rs", |
| "src/file_target.rs", |
| "src/generator.rs", |
| "src/io_header.rs", |
| "src/io_packet.rs", |
| "src/issuer.rs", |
| "src/lib.rs", |
| "src/log.rs", |
| "src/operations.rs", |
| "src/random_io_generator.rs", |
| "src/sequential_io_generator.rs", |
| "src/target.rs", |
| "src/verifier.rs", |
| ] |
| |
| odu_deps = [ |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bincode", |
| "//third_party/rust_crates:clap", |
| "//third_party/rust_crates:crc", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:log", |
| "//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:thiserror", |
| ] |
| |
| if (is_fuchsia) { |
| odu_sources += [ "src/fuchsia_utils.rs" ] |
| odu_deps += [ |
| "//src/lib/cstr", |
| "//src/lib/trace/rust:trace", |
| "//src/lib/trace/rust:trace-provider", |
| ] |
| } else { |
| odu_sources += [ "src/not_fuchsia_utils.rs" ] |
| } |
| |
| odu_version = "0.1.0" |
| |
| rustc_library("lib") { |
| edition = "2021" |
| name = "odu" |
| version = odu_version |
| with_unit_tests = true |
| |
| sources = odu_sources |
| deps = odu_deps |
| } |
| |
| # The static library can be imported into C++. |
| rustc_staticlib("libodu") { |
| edition = "2021" |
| name = "odu" |
| version = odu_version |
| |
| sources = odu_sources |
| deps = odu_deps |
| } |
| |
| fuchsia_unittest_package("odu_tests") { |
| manifest = "meta/odu_lib_test.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":lib_test($host_toolchain)", |
| ":odu_tests", |
| ] |
| } |