| # Copyright 2021 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/dist/component_manifest_resources.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":cr50_agent_unittests", |
| "client:tests", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| edition = "2021" |
| output_name = "cr50_agent" |
| with_unit_tests = true |
| |
| configs += [ "//build/config/rust:bootfs" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.power.button:fuchsia.power.button-rustc", |
| "//sdk/fidl/fuchsia.tpm:fuchsia.tpm-rustc", |
| "//sdk/fidl/fuchsia.tpm.cr50:fuchsia.tpm.cr50-rustc", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:num-derive", |
| "//third_party/rust_crates:num-traits", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ |
| "src/cr50.rs", |
| "src/cr50/command.rs", |
| "src/cr50/command/ccd.rs", |
| "src/cr50/command/pinweaver.rs", |
| "src/cr50/command/wp.rs", |
| "src/cr50/status.rs", |
| "src/main.rs", |
| "src/power_button.rs", |
| "src/util.rs", |
| ] |
| } |
| |
| component_manifest_resources("manifest") { |
| sources = [ "meta/cr50_agent.cml" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "cr50_agent" |
| manifest = "meta/cr50_agent.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("cr50_agent") { |
| package_name = "cr50_agent" |
| deps = [ ":component" ] |
| } |
| |
| group("bootfs") { |
| deps = [ |
| ":bin", |
| ":manifest", |
| "client:gsctool", |
| ] |
| } |
| |
| fuchsia_unittest_package("cr50_agent_unittests") { |
| deps = [ ":bin_test" ] |
| } |