| # 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-default/BUILD.gn.tmpl-cpp`. |
| # If you find something broken, we are eager to review fixes. |
| |
| import("//build/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/drivers.gni") |
| import("//build/test.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" ] |
| } |
| |
| driver_bind_rules("bind") { |
| rules = "my_driver_cpp.bind" |
| bind_output = "my_driver_cpp.bindbc" |
| } |
| |
| fuchsia_driver("driver") { |
| output_name = "my-driver-cpp" |
| sources = [ "my_driver_cpp.cc" ] |
| deps = [ |
| ":bind", |
| "//src/devices/lib/driver", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver_component("component") { |
| component_name = "my-driver-cpp" |
| deps = [ ":driver" ] |
| info = "my_driver_cpp-info.json" |
| manifest = "meta/component.cml" |
| } |
| |
| fuchsia_driver_package("pkg") { |
| package_name = "my-driver-cpp" |
| driver_components = [ ":component" ] |
| } |
| |
| test("my-driver-cpp-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/mock-ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("my-driver-cpp-tests") { |
| deps = [ ":my-driver-cpp-unit-tests" ] |
| } |