blob: f07eb9d3be6b4059de069828f628264e450b38d9 [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/components.gni")
import("//build/dist/component_manifest_resources.gni")
import("//build/test.gni")
executable("pwrbtn-monitor") {
if (is_fuchsia) {
configs += [ "//build/unification/config:zircon-migrated" ]
}
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
sources = [
"main.cc",
"monitor.cc",
"monitor.h",
]
deps = [
"//sdk/fidl/fuchsia.hardware.input:fuchsia.hardware.input_llcpp",
"//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_llcpp",
"//sdk/fidl/fuchsia.power.button:fuchsia.power.button_llcpp",
"//sdk/lib/fdio",
"//src/sys/lib/stdout-to-debuglog/cpp",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/hid-parser",
"//zircon/system/ulib/service:service-llcpp",
"//zircon/system/ulib/svc",
]
# 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" ]
}
test("pwrbtn-monitor-unittests-bin") {
output_name = "pwrbtn-monitor-unittests"
sources = [
"monitor-test.cc",
"monitor.cc",
"monitor.h",
]
deps = [
"//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_llcpp",
"//sdk/fidl/fuchsia.power.button:fuchsia.power.button_llcpp",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/service:service-llcpp",
"//zircon/system/ulib/zxtest",
]
}
fuchsia_unittest_package("pwrbtn-monitor-unittests") {
deps = [ ":pwrbtn-monitor-unittests-bin" ]
}
component_manifest_resources("bootfs") {
sources = [ "meta/pwrbtn-monitor.cml" ]
}
group("tests") {
testonly = true
deps = [
":pwrbtn-monitor-unittests",
"test:pwrbtn-monitor-integration-test",
]
}