| # 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/drivers.gni") |
| import("//build/test.gni") |
| |
| driver_bind_rules("pwm-bind") { |
| rules = "pwm.bind" |
| header_output = "pwm-bind.h" |
| bind_output = "pwm.bindbc" |
| tests = "bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.pwm" ] |
| } |
| |
| fuchsia_driver("pwm-driver") { |
| output_name = "pwm" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "pwm.cc" ] |
| deps = [ |
| ":common", |
| "//sdk/fidl/fuchsia.hardware.pwm:fuchsia.hardware.pwm_llcpp", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| fuchsia_driver_component("pwm") { |
| info = "pwm-info.json" |
| component_name = "pwm" |
| deps = [ ":pwm-driver" ] |
| colocate = true |
| } |
| |
| test("pwm-test-bin") { |
| output_name = "pwm-test" |
| sources = [ |
| "pwm-test.cc", |
| "pwm.cc", |
| ] |
| deps = [ |
| ":common", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| group("common") { |
| public_deps = [ |
| ":pwm-bind", |
| "//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.pwm:fuchsia.hardware.pwm_llcpp", |
| "//src/devices/lib/amlogic", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zircon-internal", |
| ] |
| } |
| |
| fuchsia_unittest_package("pwm-test") { |
| deps = [ ":pwm-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":pwm-bind_test", |
| ":pwm-test", |
| ] |
| } |