| # Copyright 2019 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| |
| source_set("optee_lib") { |
| sources = [ |
| "optee-client.cc", |
| "optee-controller.cc", |
| "optee-device-info.cc", |
| "optee-message.cc", |
| "optee-util.cc", |
| "shared-memory.cc", |
| ] |
| |
| public_deps = [ |
| "//sdk/banjo/ddk.protocol.platform.device", |
| "//sdk/banjo/ddk.protocol.rpmb", |
| "//sdk/fidl/fuchsia.hardware.rpmb:fuchsia.hardware.rpmb_llcpp", |
| "//sdk/fidl/fuchsia.hardware.tee:fuchsia.hardware.tee_llcpp", |
| "//src/devices/bus/lib/device-protocol-pdev", |
| "//src/devices/bus/lib/device-protocol-platform-device", |
| "//src/devices/lib/mmio", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/region-alloc", |
| "//zircon/system/ulib/tee-client-api:tee-client-api-headers", |
| ] |
| |
| deps = [ |
| "//sdk/banjo/ddk.protocol.composite", |
| "//sdk/banjo/ddk.protocol.sysmem", |
| "//sdk/banjo/ddk.protocol.tee", |
| "//sdk/fidl/fuchsia.tee:fuchsia.tee_llcpp", |
| "//sdk/fidl/fuchsia.tee.manager:fuchsia.tee.manager_llcpp", |
| "//src/devices/lib/driver", |
| "//zircon/public/lib/fidl", |
| "//zircon/system/ulib/fidl-utils", |
| ] |
| } |
| |
| driver_module("optee") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| deps = [ ":optee_lib" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":optee-unittest" ] |
| } |
| |
| test("optee-message-test") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| output_name = "optee-message-test" |
| include_dirs = [ "." ] |
| sources = [ "test/optee-message-test.cc" ] |
| deps = [ |
| ":optee_lib", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| test("optee-controller-test") { |
| sources = [ "test/optee-controller-test.cc" ] |
| include_dirs = [ "." ] |
| deps = [ |
| ":optee_lib", |
| "//sdk/banjo/ddk.protocol.composite", |
| "//sdk/banjo/ddk.protocol.sysmem", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake-resource", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| test("optee-client-test") { |
| sources = [ "test/optee-client-test.cc" ] |
| include_dirs = [ "." ] |
| deps = [ |
| ":optee_lib", |
| "//sdk/banjo/ddk.protocol.composite", |
| "//sdk/banjo/ddk.protocol.sysmem", |
| "//sdk/lib/fidl/cpp", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake-resource", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/testing/loop_fixture", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| unittest_package("optee-unittest") { |
| deps = [ |
| ":optee-client-test", |
| ":optee-controller-test", |
| ":optee-message-test", |
| ] |
| tests = [ |
| { |
| name = "optee-message-test" |
| }, |
| { |
| name = "optee-controller-test" |
| }, |
| { |
| name = "optee-client-test" |
| }, |
| ] |
| } |