blob: 19016f0cd4a06f20f8973b15078399429a931fca [file] [log] [blame]
# 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/bind/bind.gni")
import("//build/config/fuchsia/rules.gni")
import("//build/test.gni")
import("//src/sys/build/components.gni")
bind_rules("optee-bind") {
rules = "optee.bind"
output = "optee-bind.h"
tests = "optee-bind-test.json"
deps = [ "//src/devices/bind/fuchsia.platform" ]
}
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/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.rpmb",
"//sdk/fidl/fuchsia.hardware.rpmb:fuchsia.hardware.rpmb_llcpp",
"//sdk/fidl/fuchsia.hardware.tee:fuchsia.hardware.tee_llcpp",
"//sdk/lib/fit-promise",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/bus/lib/device-protocol-platform-device",
"//src/devices/lib/mmio",
"//src/lib/ddk",
"//src/lib/ddktl",
"//src/security/tee/tee-client-api:tee-client-api-headers",
"//zircon/public/lib/fbl",
"//zircon/public/lib/zircon-internal",
"//zircon/public/lib/zx",
"//zircon/system/ulib/region-alloc",
]
deps = [
":optee-bind",
"//sdk/banjo/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.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-bind_test",
":optee-unittest",
]
}
test("optee-message-test-bin") {
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-bin") {
sources = [ "test/optee-controller-test.cc" ]
include_dirs = [ "." ]
output_name = "optee-controller-test"
deps = [
":optee_lib",
"//sdk/banjo/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_banjo_cpp",
"//src/devices/testing/fake-bti",
"//src/devices/testing/fake-resource",
"//src/devices/testing/fake_ddk",
"//zircon/public/lib/zxtest",
]
}
test("optee-client-test-bin") {
sources = [ "test/optee-client-test.cc" ]
include_dirs = [ "." ]
output_name = "optee-client-test"
deps = [
":optee_lib",
"//sdk/banjo/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_banjo_cpp",
"//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",
]
}
test("optee-uuid-test-bin") {
sources = [ "test/optee-uuid-test.cc" ]
include_dirs = [ "." ]
output_name = "optee-uuid-test"
deps = [
":optee_lib",
"//sdk/banjo/fuchsia.hardware.tee",
"//sdk/fidl/fuchsia.tee:fuchsia.tee_llcpp",
"//zircon/public/lib/zxtest",
]
}
fuchsia_unittest_component("optee-client-test") {
deps = [ ":optee-client-test-bin" ]
}
fuchsia_unittest_component("optee-controller-test") {
deps = [ ":optee-controller-test-bin" ]
}
fuchsia_unittest_component("optee-message-test") {
deps = [ ":optee-message-test-bin" ]
}
fuchsia_unittest_component("optee-uuid-test") {
deps = [ ":optee-uuid-test-bin" ]
}
fuchsia_test_package("optee-unittest") {
test_components = [
":optee-client-test",
":optee-controller-test",
":optee-message-test",
":optee-uuid-test",
]
}