| # Copyright 2020 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. |
| |
| # This file was generated by the `fx create` command. The template |
| # is located at `//tools/create/templates/driver/BUILD.gn.tmpl-cpp`. |
| # If you find something broken, we are eager to review fixes. |
| |
| import("//build/bind/bind.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//src/sys/build/components.gni") |
| |
| group("my-driver-cpp") { |
| testonly = true |
| deps = [ |
| ":pkg", |
| ":tests", |
| ] |
| } |
| |
| # TODO: Remember to link this to ../BUILD.gn tests group so that the tests are included. |
| # Then delete this comment. |
| group("tests") { |
| testonly = true |
| deps = [ ":my-driver-cpp-tests" ] |
| } |
| |
| bind_rules("bind") { |
| rules = "my_driver_cpp.bind" |
| output = "my_driver_cpp-bind.h" |
| } |
| |
| driver_module("driver") { |
| output_name = "my-driver-cpp" |
| sources = [ "my_driver_cpp.cc" ] |
| deps = [ |
| ":bind", |
| "//src/devices/lib/driver", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| fuchsia_system_package("pkg") { |
| package_name = "my-driver-cpp" |
| deps = [ ":driver" ] |
| |
| # Remove the line below when this package is only used by the system image. |
| allowed_in_extra_deps = true |
| } |
| |
| test("unit-tests") { |
| sources = [ |
| "my_driver_cpp.cc", |
| "my_driver_cpp.h", |
| "unit-tests.cc", |
| ] |
| deps = [ |
| ":bind", |
| "//sdk/lib/inspect/testing/cpp:zxtest", |
| "//src/devices/lib/driver", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| fuchsia_unittest_package("my-driver-cpp-tests") { |
| deps = [ ":unit-tests" ] |
| } |