| # Copyright 2020 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("lib") { |
| edition = "2021" |
| name = "lspci" |
| with_unit_tests = true |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:bitfield", |
| "//third_party/rust_crates:zerocopy", |
| ] |
| test_deps = [ |
| ":database", |
| "//third_party/rust_crates:lazy_static", |
| ] |
| sources = [ |
| "src/bridge.rs", |
| "src/capability.rs", |
| "src/config.rs", |
| "src/db.rs", |
| "src/device.rs", |
| "src/filter.rs", |
| "src/lib.rs", |
| "src/util.rs", |
| ] |
| } |
| |
| rustc_binary("lspci") { |
| edition = "2021" |
| with_unit_tests = true |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| ] |
| sources = [ "src/main.rs" ] |
| configs += [ "//build/config/rust:bootfs" ] |
| } |
| |
| resource("database") { |
| sources = [ "//third_party/pciids/pci.ids" ] |
| outputs = [ "data/lspci/{{source_file_part}}" ] |
| } |
| |
| fuchsia_unittest_package("lspci-tests") { |
| deps = [ ":lib_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":lspci-tests" ] |
| } |
| |
| group("bootfs") { |
| deps = [ |
| ":database", |
| ":lspci", |
| ] |
| } |