blob: 339f0d0b3fd9568cc2a3ef35829f68ae57e25e68 [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/components.gni")
import("//build/drivers.gni")
import("//src/camera/debug.gni")
group("tests") {
testonly = true
deps = [
":gdc_bind_test",
":gdc_task_unittest",
]
}
driver_bind_rules("gdc_bind") {
rules = "gdc.bind"
header_output = "bind.h"
tests = "bind_tests.json"
deps = [ "//src/devices/bind/fuchsia.arm.platform" ]
}
source_set("lib") {
defines = [ camera_debug_define ]
visibility = [ "../*" ]
sources = [
"gdc.cc",
"gdc_task.cc",
]
public_deps = [
":gdc_bind",
"//sdk/banjo/fuchsia.hardware.clock:fuchsia.hardware.clock_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.gdc:fuchsia.hardware.gdc_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.platform.bus:fuchsia.hardware.platform.bus_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_banjo_cpp",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_c",
"//sdk/lib/fit",
"//sdk/lib/syslog/cpp",
"//src/camera/drivers/hw_accel/task:camera-task",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/bus/lib/device-protocol-platform-device",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/hwreg",
"//zircon/system/ulib/image-format",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/syslog",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/trace:trace-driver",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_driver("fuchsia_driver") {
output_name = "gdc"
deps = [
":lib",
"//sdk/lib/syslog/cpp:backend_legacy",
]
configs += [ "//build/config/fuchsia:enable_zircon_asserts" ]
}
fuchsia_driver_component("driver") {
component_name = "gdc"
deps = [ ":fuchsia_driver" ]
info = "driver-info.json"
colocate = true
}
fuchsia_driver_package("gdc") {
driver_components = [ ":driver" ]
}
executable("gdc_task_unittest_bin") {
testonly = true
sources = [ "gdc_task_unittest.cc" ]
deps = [
":lib",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_c",
"//src/camera/drivers/test_utils",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
"//src/devices/testing/fake-bti",
"//src/devices/testing/mock-mmio-reg",
"//src/devices/testing/no_ddk",
"//src/lib/fsl",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
# TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_unittest_package("gdc_task_unittest") {
deps = [ ":gdc_task_unittest_bin" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}