blob: 67fd659cf070730ff906ac2a33812c757adb2fff [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/config.gni")
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
import("//third_party/cobalt/metrics_registry.gni")
metrics_registry("power_manager_metrics") {
# ID of the 'power' project from the //third_party/cobalt_config/projects.yaml file
project_id = 3
# The namespace to use in the generated code
namespace = "power_manager_metrics"
# Generates a rust target called 'power_manager_metrics_rustlib'
generate_rust = true
}
rustc_binary("bin") {
name = "power_manager"
edition = "2018"
with_unit_tests = true
deps = [
":power_manager_metrics_rustlib",
"//sdk/fidl/fuchsia.feedback:fuchsia.feedback-rustc",
"//sdk/fidl/fuchsia.hardware.cpu.ctrl:fuchsia.hardware.cpu.ctrl-rustc",
"//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal-rustc",
"//sdk/fidl/fuchsia.kernel:fuchsia.kernel-rustc",
"//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo-rustc",
"//sdk/fidl/fuchsia.thermal:fuchsia.thermal-rustc",
"//src/lib/cobalt/rust:fuchsia-cobalt",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/inspect/rust/fuchsia-inspect",
"//src/lib/inspect/rust/fuchsia-inspect-contrib",
"//src/lib/syslog/rust:syslog",
"//src/lib/trace/rust:trace",
"//src/lib/trace/rust:trace-provider",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:num-traits",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_derive",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:thiserror",
"//zircon/system/fidl/fuchsia-cobalt:fuchsia-cobalt-rustc",
"//zircon/system/fidl/fuchsia-device:fuchsia-device-rustc",
"//zircon/system/fidl/fuchsia-device-manager:fuchsia-device-manager-rustc",
]
test_deps = [
"//garnet/bin/power_manager/rkf45:lib",
"//src/lib/test_util",
"//third_party/rust_crates:matches",
]
# TODO(47946): Fix the leaks and remove this.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}
package("power_manager") {
deps = [ ":bin" ]
binary = "power_manager"
meta = [
{
path = rebase_path("meta/power_manager.cmx")
dest = "power_manager.cmx"
},
]
}
test_package("power_manager_tests") {
deps = [ ":bin_test" ]
tests = [
{
name = "power_manager_bin_test"
},
]
}
config_data("sysmgr_config") {
for_pkg = "sysmgr"
sources = [ rebase_path("config/power_manager.config") ]
}
group("astro_config") {
deps = [
":sysmgr_config",
"node_config:astro",
]
}