blob: 6ece200f8b7795d5d9a737ea73596fd11c1eb407 [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")
assert(current_cpu == "x64")
driver_bind_rules("intel_rtc_bind") {
rules = "intel_rtc.bind"
header_output = "intel_rtc_bind.h"
tests = "bind-tests.json"
deps = [ "//src/devices/bind/fuchsia.acpi" ]
}
common_deps = [
":intel_rtc_bind",
"//sdk/fidl/fuchsia.hardware.nvram:fuchsia.hardware.nvram_llcpp",
"//sdk/fidl/fuchsia.hardware.rtc:fuchsia.hardware.rtc_c",
"//sdk/fidl/fuchsia.hardware.rtc:fuchsia.hardware.rtc_llcpp",
"//src/devices/lib/acpi",
"//src/devices/lib/driver",
"//src/devices/rtc/lib/rtc",
"//src/devices/rtc/lib/rtc:rtc_llcpp",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/third_party/ulib/safemath",
]
fuchsia_driver("intel-rtc-driver") {
output_name = "intel-rtc"
sources = [ "intel-rtc.cc" ]
deps = common_deps
# TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
# TODO(fxbug.dev/85473): This target uses |fidl::WireTryDispatch| which is deprecated.
# Please remove ad-hoc composition of FIDL protocols and migrate to |fidl::WireDispatch|.
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-wire-try-dispatch" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_driver_component("intel-rtc") {
info = "intel-rtc-info.json"
component_name = "intel-rtc"
deps = [ ":intel-rtc-driver" ]
colocate = true
}
test("intel-rtc-test-bin") {
output_name = "intel-rtc-test"
sources = [
"intel-rtc-test.cc",
"intel-rtc.cc",
]
cflags = [ "-DFOR_TEST" ]
deps = common_deps + [
"//src/devices/testing/mock-ddk",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/zxtest",
]
# TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
# TODO(fxbug.dev/85473): This target uses |fidl::WireTryDispatch| which is deprecated.
# Please remove ad-hoc composition of FIDL protocols and migrate to |fidl::WireDispatch|.
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-wire-try-dispatch" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_unittest_package("intel-rtc-test") {
deps = [ ":intel-rtc-test-bin" ]
}
group("tests") {
testonly = true
deps = [
":intel-rtc-test",
":intel_rtc_bind_test",
]
}