| # 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("//build/test.gni") |
| |
| driver_bind_rules("hid_input_report_bind") { |
| rules = "hid_input_report.bind" |
| header_output = "hid_input_report_bind.h" |
| bind_output = "hid-input-report.bindbc" |
| tests = "bind_tests.json" |
| deps = [ "//src/devices/bind/fuchsia.hid" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":hid-input-report-test", |
| ":hid_input_report_bind_test", |
| ] |
| } |
| |
| source_set("driver-internals") { |
| sources = [ |
| "input-report.cc", |
| "input-reports-reader.cc", |
| ] |
| deps = [ |
| ":hid_input_report_bind", |
| "//sdk/fidl/fuchsia.hardware.input:fuchsia.hardware.input_c", |
| "//sdk/fidl/fuchsia.input.report:fuchsia.input.report_llcpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/fidl", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/hid-parser", |
| "//zircon/system/ulib/trace:trace-driver", |
| ] |
| |
| public_deps = [ |
| "//sdk/banjo/fuchsia.hardware.hiddevice:fuchsia.hardware.hiddevice_banjo_cpp", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/ui/input/lib/hid-input-report", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| # TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated, |
| # rather than builders. |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] |
| } |
| |
| fuchsia_driver("hid-input-report-driver") { |
| output_name = "hid-input-report" |
| sources = [ "driver_v1.cc" ] |
| deps = [ |
| ":driver-internals", |
| ":hid_input_report_bind", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| fuchsia_driver_component("hid-input-report") { |
| component_name = "hid-input-report" |
| deps = [ ":hid-input-report-driver" ] |
| info = "hid-input-report-info.json" |
| colocate = true |
| } |
| |
| fuchsia_driver("hid-input-report-driver-v2") { |
| output_name = "hid-input-report-v2" |
| sources = [ "driver_v2.cc" ] |
| deps = [ |
| ":driver-internals", |
| ":hid_input_report_bind", |
| "//sdk/lib/driver2:devfs_exporter", |
| "//sdk/lib/driver2:inspect", |
| "//sdk/lib/driver2:llcpp", |
| "//sdk/lib/sys/component/llcpp", |
| "//src/devices/lib/compat", |
| "//src/devices/lib/driver:driver_runtime", |
| ] |
| } |
| |
| fuchsia_driver_component("hid-input-report-v2") { |
| component_name = "hid-input-report-v2" |
| manifest = "meta/hid-input-report.cml" |
| deps = [ ":hid-input-report-driver-v2" ] |
| info = "hid-input-report-info.json" |
| } |
| |
| test("hid-input-report-test-bin") { |
| sources = [ |
| "driver_v1.cc", |
| "test.cc", |
| ] |
| deps = [ |
| ":driver-internals", |
| ":hid_input_report_bind", |
| "//sdk/lib/inspect/testing/cpp:zxtest", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk:ddk-metadata-headers", |
| "//src/ui/input/lib/hid-input-report", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/fidl", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/hid-parser", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/trace:trace-driver", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated, |
| # rather than builders. |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] |
| } |
| |
| fuchsia_unittest_package("hid-input-report-test") { |
| deps = [ ":hid-input-report-test-bin" ] |
| } |