| # 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/ddk.protocol.scpi", |
| "//sdk/fidl/fuchsia.hardware.gpu.clock:fuchsia.hardware.gpu.clock_c_client", |
| "//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal_c", |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/async-default", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/ddk", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fzl", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/trace-provider-with-fdio", |
| "//zircon/public/lib/zx", |
| "//zircon/system/fidl/fuchsia-boot:fuchsia-boot_c", |
| "//zircon/system/ulib/fdio-caller", |
| ] |
| } |
| } |
| |
| 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", |
| ] |
| } |
| |
| 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" ] |
| |
| binary = "thermd" |
| |
| meta = [ |
| { |
| path = rebase_path(manifest_path) |
| dest = "thermd.cmx" |
| }, |
| ] |
| } |
| |
| config_data("config") { |
| for_pkg = "sysmgr" |
| sources = [ "thermd.config" ] |
| } |