blob: 571c8eca8d51b18d74193d2d4a99847e51b9a121 [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("hid-buttons-bind") {
rules = "hid-buttons.bind"
output = "hid-buttons-bind.h"
tests = "bind-tests.json"
deps = [ "//src/devices/bind/fuchsia.platform" ]
}
driver_module("hid-buttons") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
configs += [ "//build/unification/config:zircon-migrated" ]
sources = []
deps = [
":common",
"//src/devices/lib/driver",
]
}
source_set("common") {
configs += [ "//build/config:all_source" ]
sources = [ "hid-buttons.cc" ]
public_deps = [
":hid-buttons-bind",
"//sdk/banjo/fuchsia.hardware.buttons",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.hidbus",
"//sdk/fidl/fuchsia.buttons:fuchsia.buttons_llcpp",
"//src/lib/ddk",
"//src/lib/ddk:ddk-metadata-headers",
"//src/lib/ddktl",
"//zircon/public/lib/async-cpp",
"//zircon/public/lib/fbl",
"//zircon/public/lib/sync",
"//zircon/public/lib/zircon-internal",
"//zircon/public/lib/zx",
"//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",
]
# 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-buttons-test") {
configs += [
"//build/config:all_source",
"//build/unification/config:zircon-migrated",
]
output_name = "hid-buttons-test"
sources = [ "hid-buttons-test.cc" ]
deps = [
":common",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp_mock",
"//src/devices/testing/fake_ddk",
"//zircon/public/lib/mock-function",
"//zircon/public/lib/zxtest",
]
# 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-buttons-test-package") {
package_name = "hid-buttons-test"
deps = [ ":hid-buttons-test" ]
}
group("tests") {
testonly = true
deps = [
":hid-buttons-bind_test",
":hid-buttons-test-package",
]
}