blob: e77a68144629021d246103d19a17040bed54a5da [file] [log] [blame]
# Copyright 2018 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")
if (target_cpu == "x64") {
executable("bin") {
output_name = "thermd"
sources = [ "thermd.cc" ]
deps = [
"//sdk/banjo/fuchsia.hardware.scpi",
"//sdk/fidl/fuchsia.boot:fuchsia.boot_c",
"//sdk/fidl/fuchsia.hardware.gpu.clock:fuchsia.hardware.gpu.clock_c_client",
"//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal_c",
"//sdk/lib/fdio",
"//src/lib/ddk",
"//zircon/public/lib/async",
"//zircon/public/lib/zx",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/trace-provider:trace-provider-with-fdio",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
}
if (target_cpu == "arm64") {
rustc_binary("bin") {
name = "thermd"
edition = "2018"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.hardware.gpu.clock:fuchsia.hardware.gpu.clock-rustc",
"//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
]
sources = [ "src/main.rs" ]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
test_package("thermd_tests_package") {
deps = [ ":bin_test" ]
tests = [
{
name = "thermd_bin_test"
},
]
}
}
package("thermd") {
if (target_cpu == "arm64") {
manifest_path = "meta/thermd_arm.cmx"
} else {
manifest_path = "meta/thermd.cmx"
}
deps = [ ":bin" ]
binaries = [
{
name = "thermd"
},
]
meta = [
{
path = rebase_path(manifest_path)
dest = "thermd.cmx"
},
]
}
config_data("config") {
for_pkg = "sysmgr"
sources = [ "thermd.config" ]
}