blob: c25caff86ba6a290955e9f873ad8fba7ebd3e11b [file] [log] [blame]
# 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("aml_light_bind") {
rules = "aml_light.bind"
header_output = "aml_light_bind.h"
bind_output = "aml-light.bindbc"
tests = "bind_tests.json"
deps = [
"//src/devices/bind/fuchsia.amlogic.platform",
"//src/devices/bind/fuchsia.platform",
]
}
fuchsia_driver("aml-light-driver") {
output_name = "aml-light"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [ "aml-light.cc" ]
deps = [
":aml_light_bind",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp",
"//sdk/fidl/fuchsia.hardware.light:fuchsia.hardware.light_llcpp",
"//src/devices/lib/amlogic",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddk:ddk-metadata-headers",
"//src/lib/ddktl",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fidl",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zx",
]
}
fuchsia_driver_component("aml-light") {
component_name = "aml-light"
deps = [ ":aml-light-driver" ]
info = "aml-light-info.json"
colocate = true
}
test("aml-light-test") {
output_name = "aml-light-test"
sources = [
"aml-light-test.cc",
"aml-light.cc",
]
deps = [
":aml_light_bind",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp_mock",
"//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp_mock",
"//sdk/fidl/fuchsia.hardware.light:fuchsia.hardware.light_llcpp",
"//src/devices/lib/amlogic",
"//src/devices/testing/no_ddk",
"//src/lib/ddk",
"//src/lib/ddk:ddk-metadata-headers",
"//src/lib/ddktl",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fidl",
"//zircon/system/ulib/fidl-async:fidl-async-cpp",
"//zircon/system/ulib/mock-function",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
# 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("aml-light-test-package") {
package_name = "aml-light-test"
deps = [ ":aml-light-test" ]
}
group("tests") {
testonly = true
deps = [
":aml-light-test-package",
":aml_light_bind_test",
]
}