| # 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/test.gni") |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "critical-services" |
| manifest = "meta/critical-services.cml" |
| } |
| |
| fuchsia_structured_config_cpp_elf_lib("pwrbtn_monitor_config") { |
| cm_label = ":manifest" |
| } |
| |
| executable("critical-services") { |
| sources = [ |
| "main.cc", |
| "monitor.cc", |
| "monitor.h", |
| "oom_watcher.cc", |
| "oom_watcher.h", |
| ] |
| deps = [ |
| ":pwrbtn_monitor_config", |
| "//sdk/fidl/fuchsia.hardware.input:fuchsia.hardware.input_cpp", |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_cpp", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp", |
| "//sdk/fidl/fuchsia.power.button:fuchsia.power.button_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/sys/cpp", |
| "//src/bringup/bin/critical-services/crashsvc", |
| "//src/sys/lib/stdout-to-debuglog/cpp", |
| "//src/ui/input/lib/hid-parser", |
| "//zircon/system/ulib/async-default", |
| "//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/svc", |
| ] |
| |
| public_deps = [ "//zircon/system/ulib/zx" ] |
| } |
| |
| test("critical-services-unittests-bin") { |
| output_name = "critical-services-unittests" |
| sources = [ |
| "monitor-test.cc", |
| "monitor.cc", |
| "monitor.h", |
| "oom_watcher-test.cc", |
| "oom_watcher.cc", |
| "oom_watcher.h", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol_cpp", |
| "//sdk/fidl/fuchsia.power.button:fuchsia.power.button_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("critical-services-unittests") { |
| deps = [ ":critical-services-unittests-bin" ] |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":manifest" |
| deps = [ ":critical-services" ] |
| } |
| |
| fuchsia_package("package") { |
| package_name = "critical-services" |
| deps = [ ":component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":critical-services-unittests", |
| "test:critical-services-integration-test", |
| ] |
| } |