| # 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/cipd.gni") |
| import("//build/components.gni") |
| import("//build/drivers.gni") |
| import("//build/test.gni") |
| |
| driver_bind_rules("focaltech_touch_bind") { |
| rules = "focaltech_touch.bind" |
| header_output = "focaltech_touch_bind.h" |
| bind_output = "focaltech.bindbc" |
| tests = "bind_tests.json" |
| deps = [ "//src/devices/bind/fuchsia.platform" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":focaltech-test", |
| ":focaltech_touch_bind_test", |
| ] |
| } |
| |
| source_set("firmware-sherlock") { |
| sources = [ "ft_firmware_sherlock.cc" ] |
| cflags_cc = [ "-Wno-newline-eof" ] |
| } |
| |
| group("common") { |
| public_deps = [ |
| ":focaltech_touch_bind", |
| "//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.i2c:fuchsia.hardware.i2c_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.test:fuchsia.hardware.test_banjo_cpp", |
| "//sdk/fidl/fuchsia.input.report:fuchsia.input.report_llcpp", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/focaltech", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/trace:trace-driver", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxc", |
| ] |
| } |
| |
| fuchsia_driver("focaltech-driver") { |
| output_name = "focaltech" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ |
| "ft_device.cc", |
| "ft_firmware.cc", |
| "ft_firmware_none.cc", |
| ] |
| deps = [ ":common" ] |
| } |
| |
| fuchsia_driver_component("focaltech") { |
| component_name = "focaltech" |
| deps = [ ":focaltech-driver" ] |
| info = "focaltech-info.json" |
| colocate = true |
| } |
| |
| fuchsia_driver("focaltech-sherlock-driver") { |
| output_name = "focaltech-sherlock" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ |
| "ft_device.cc", |
| "ft_firmware.cc", |
| ] |
| deps = [ ":common" ] |
| |
| if (internal_access) { |
| deps += [ ":firmware-sherlock" ] |
| } else { |
| sources += [ "ft_firmware_none.cc" ] |
| } |
| } |
| |
| fuchsia_driver_component("focaltech-sherlock") { |
| component_name = "focaltech-sherlock" |
| deps = [ ":focaltech-sherlock-driver" ] |
| info = "focaltech-sherlock-info.json" |
| colocate = true |
| } |
| |
| test("focaltech-test-bin") { |
| output_name = "focaltech-test" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "ft_device.cc", |
| "ft_device_test.cc", |
| "ft_firmware.cc", |
| ] |
| deps = [ |
| ":common", |
| "//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp_mock", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/system/ulib/zxc", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("focaltech-test") { |
| deps = [ ":focaltech-test-bin" ] |
| } |