| # 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("hidctl_bind") { |
| rules = "hidctl.bind" |
| header_output = "hidctl_bind.h" |
| tests = "bind_tests.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.test", |
| "//src/devices/bind/fuchsia.test.platform", |
| ] |
| } |
| |
| fuchsia_driver("hidctl-driver") { |
| output_name = "hidctl" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "hidctl.cc" ] |
| deps = [ |
| ":hidctl_bind", |
| "//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.hidctl:fuchsia.hardware.hidctl_llcpp", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/pretty", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver_component("hidctl") { |
| component_name = "hidctl" |
| deps = [ ":hidctl-driver" ] |
| info = "hidctl-info.json" |
| colocate = true |
| } |
| |
| executable("hidctl-test") { |
| testonly = true |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "hidctl-test.cc", |
| "hidctl.cc", |
| ] |
| deps = [ |
| ":hidctl_bind", |
| "//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.hidctl:fuchsia.hardware.hidctl_llcpp", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/pretty", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("hidctl-test-package") { |
| deps = [ ":hidctl-test" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":hidctl-test-package", |
| ":hidctl_bind_test", |
| ] |
| } |