| # 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" |
| bind_output = "focaltech.bindbc" |
| tests = "bind_tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_bindlib", |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_bindlib", |
| "//src/devices/bind/fuchsia.devicetree", |
| "//src/devices/bind/fuchsia.focaltech.platform", |
| "//src/devices/bind/fuchsia.gpio", |
| "//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/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_cpp", |
| "//sdk/fidl/fuchsia.input.report:fuchsia.input.report_cpp", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/devices/lib/focaltech", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| 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" |
| manifest = "meta/focaltech.cml" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "focaltech" |
| driver_components = [ ":focaltech" ] |
| } |
| |
| 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" |
| manifest = "meta/focaltech-sherlock.cml" |
| } |
| |
| fuchsia_driver_package("focaltech-sherlock-package") { |
| package_name = "focaltech-sherlock" |
| driver_components = [ ":focaltech-sherlock" ] |
| } |
| |
| 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/lib/async_patterns/testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/devices/gpio/testing/fake-gpio", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/devices/testing/mock-ddk", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zx", |
| ] |
| defines = [ "FT_TEST" ] |
| } |
| |
| fuchsia_unittest_package("focaltech-test") { |
| deps = [ ":focaltech-test-bin" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |