| # 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("ssd1306-bind") { |
| rules = "ssd1306.bind" |
| output = "ssd1306-bind.h" |
| tests = "bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.platform" ] |
| } |
| |
| driver_module("ssd1306_driver") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ "ssd1306.cc" ] |
| deps = [ |
| ":ssd1306-bind", |
| "//sdk/banjo/fuchsia.hardware.dotmatrixdisplay", |
| "//sdk/banjo/fuchsia.hardware.i2c", |
| "//sdk/fidl/fuchsia.hardware.dotmatrixdisplay:fuchsia.hardware.dotmatrixdisplay_c", |
| "//src/devices/i2c/lib/device-protocol-i2c", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| ] |
| } |
| |
| fuchsia_system_package("ssd1306") { |
| deps = [ ":ssd1306_driver" ] |
| } |
| |
| test("ssd1306-test") { |
| sources = [ |
| "ssd1306.cc", |
| "test.cc", |
| ] |
| |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| |
| deps = [ |
| ":ssd1306-bind", |
| "//sdk/banjo/fuchsia.hardware.dotmatrixdisplay", |
| "//sdk/banjo/fuchsia.hardware.i2c", |
| "//sdk/fidl/fuchsia.hardware.dotmatrixdisplay:fuchsia.hardware.dotmatrixdisplay_c", |
| "//src/devices/i2c/lib/device-protocol-i2c", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/devices/lib/driver", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxtest", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ssd1306-bind_test", |
| ":ssd1306-test-package", |
| ] |
| } |
| |
| fuchsia_unittest_package("ssd1306-test-package") { |
| package_name = "ssd1306-test" |
| deps = [ ":ssd1306-test" ] |
| } |