| # 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/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//src/sys/build/components.gni") |
| |
| rustc_library("lib") { |
| name = "cs" |
| edition = "2018" |
| with_unit_tests = true |
| source_root = "lib/mod.rs" |
| |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect-rustc", |
| "//sdk/fidl/fuchsia.inspect.deprecated:fuchsia.inspect.deprecated-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:tempfile" ] |
| |
| sources = [ |
| "lib/freq.rs", |
| "lib/io.rs", |
| "lib/log_stats.rs", |
| "lib/mod.rs", |
| "lib/v1.rs", |
| "lib/v2.rs", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| name = "cs_bin" |
| edition = "2018" |
| source_root = "main.rs" |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.inspect.deprecated:fuchsia.inspect.deprecated-rustc", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:structopt", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ "main.rs" ] |
| } |
| |
| package("cs") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "cs_bin" |
| dest = "cs" |
| shell = true |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/cs.cmx") |
| dest = "cs.cmx" |
| }, |
| ] |
| } |
| |
| fuchsia_unittest_package("cs-unittests") { |
| manifest = "meta/cs-unittests.cmx" |
| deps = [ ":lib_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":cs-unittests", |
| "tests:cs-tests", |
| ] |
| } |