| # 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| |
| bind_rules("hid_bind") { |
| rules = "hid.bind" |
| output = "hid_bind.h" |
| tests = "tests.json" |
| deps = [ "//src/devices/bind/fuchsia.hid" ] |
| } |
| |
| driver_module("hid") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ |
| "device-report-reader.cc", |
| "hid-fifo.c", |
| "hid-instance.cc", |
| "hid.cc", |
| ] |
| deps = [ |
| ":hid_bind", |
| "//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.hiddevice:fuchsia.hardware.hiddevice_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.input:fuchsia.hardware.input_llcpp", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/listnode", |
| "//zircon/public/lib/fbl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/hid-parser", |
| "//zircon/system/ulib/trace:trace-driver", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| test("hid-test") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ |
| "device-report-reader.cc", |
| "hid-fifo.c", |
| "hid-instance.cc", |
| "hid-test.cc", |
| "hid.cc", |
| ] |
| deps = [ |
| ":hid_bind", |
| "//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.hiddevice:fuchsia.hardware.hiddevice_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.input:fuchsia.hardware.input_llcpp", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/listnode", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/hid-parser", |
| "//zircon/system/ulib/trace:trace-driver", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| fuchsia_unittest_package("hid-test-package") { |
| package_name = "hid-test" |
| deps = [ ":hid-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":hid-test-package", |
| ":hid_bind_test", |
| ] |
| } |