blob: 3421c6d2ba02bf2a3f7e226378000ca8a8148339 [file] [log] [blame]
# Copyright 2024 The Fuchsia Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components/fuchsia_component.gni")
import("//build/components/fuchsia_package.gni")
import("//build/components/fuchsia_test.gni")
import("//build/components/fuchsia_test_package.gni")
import("//build/components/fuchsia_unittest_component.gni")
import("//build/rust/rustc_binary.gni")
rustc_binary("runtime") {
edition = "2021"
output_name = "ta_runtime"
sources = [
"src/main.rs",
"src/params.rs",
"src/ta_loader.rs",
"src/trusted_app.rs",
]
deps = [
"//sdk/fidl/fuchsia.tee:fuchsia.tee_rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/tee/tee_internal_api:tee_internal_impl",
"//src/tee/tee_internal_api:tee_internal_stub_so",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:tracing",
]
with_unit_tests = true
# This file lists the dynamic symbols for the TEE_... entry points the runtime
# implements. These are exported for the TA to resolve when loaded.
inputs = [ "ta_runtime_exposed_symbols.sym" ]
link_args = [ "--dynamic-list=" + rebase_path(inputs[0], root_build_dir) ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("runtime-component") {
manifest = "meta/ta-runtime.cml"
component_name = "ta-runtime"
deps = [ ":runtime" ]
}
fuchsia_unittest_component("runtime-test-component") {
deps = [ ":runtime_test" ]
component_name = "tee-runtime-test"
}
fuchsia_test_package("tee-runtime-tests-package") {
test_components = [ ":runtime-test-component" ]
}
group("tests") {
testonly = true
deps = [ ":tee-runtime-tests-package" ]
}