| # 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("spi_bind") { |
| rules = "spi.bind" |
| output = "spi_bind.h" |
| tests = "tests.json" |
| deps = [ "//src/devices/bind/fuchsia.spi" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":spi-test", |
| ":spi_bind_test", |
| ] |
| } |
| |
| driver_module("spi") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ |
| "spi-child.cc", |
| "spi.cc", |
| ] |
| deps = [ |
| ":spi_bind", |
| "//sdk/banjo/fuchsia.hardware.spi:fuchsia.hardware.spi_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.spiimpl", |
| "//sdk/fidl/fuchsia.hardware.spi:fuchsia.hardware.spi_llcpp", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/fidl:fidl-llcpp", |
| "//zircon/system/ulib/fidl-utils", |
| ] |
| |
| # 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("spi-test-bin") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "spi-test" |
| sources = [ |
| "spi-child.cc", |
| "spi-test.cc", |
| "spi.cc", |
| ] |
| deps = [ |
| ":spi_bind", |
| "//sdk/banjo/fuchsia.hardware.platform.bus:fuchsia.hardware.platform.bus_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.spi:fuchsia.hardware.spi_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.spiimpl", |
| "//sdk/fidl/fuchsia.hardware.spi:fuchsia.hardware.spi_llcpp", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddk:ddk-metadata-headers", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl:fidl-llcpp", |
| "//zircon/system/ulib/fidl-utils", |
| "//zircon/system/ulib/spi", |
| ] |
| |
| # 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("spi-test") { |
| deps = [ ":spi-test-bin" ] |
| } |