| # Copyright 2022 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//common-mk/generate-dbus-adaptors.gni") |
| import("//common-mk/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":dbus_conf", |
| ":discod", |
| ":install_minijail_conf", |
| ":upstart_conf", |
| ] |
| if (use.test) { |
| deps += [ ":discod_testrunner" ] |
| } |
| } |
| |
| install_config("dbus_conf") { |
| sources = [ "dbus_bindings/org.chromium.Discod.conf" ] |
| install_path = "/etc/dbus-1/system.d/" |
| } |
| |
| install_config("install_minijail_conf") { |
| sources = [ "init/minijail/discod.conf" ] |
| install_path = "/usr/share/minijail/" |
| } |
| |
| install_config("upstart_conf") { |
| sources = [ "init/discod.conf" ] |
| install_path = "/etc/init" |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| "libmetrics", |
| ] |
| libs = [ |
| "rootdev", |
| "hwsec-foundation", |
| ] |
| } |
| |
| generate_dbus_adaptors("libdiscod-adaptors") { |
| dbus_service_config = "dbus_bindings/dbus-service-config.json" |
| dbus_adaptors_out_dir = "include/discod/dbus_adaptors" |
| sources = [ "dbus_bindings/org.chromium.Discod.xml" ] |
| } |
| |
| static_library("libdiscod") { |
| sources = [ |
| "control_loop.cc", |
| "controls/file_based_binary_control.cc", |
| "controls/real_ufs_write_booster_control_logic.cc", |
| "daemon.cc", |
| "metrics/real_metrics.cc", |
| "server.cc", |
| "utils/ufs.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| deps = [ ":libdiscod-adaptors" ] |
| } |
| |
| executable("discod") { |
| sources = [ "main.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ ":libdiscod" ] |
| install_path = "/usr/sbin" |
| } |
| |
| if (use.test) { |
| pkg_config("discod_test_config") { |
| pkg_deps = [ "libchrome-test" ] |
| } |
| executable("discod_testrunner") { |
| sources = [ |
| "controls/file_based_binary_control_test.cc", |
| "controls/real_ufs_write_booster_control_logic_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":discod_test_config", |
| ":target_defaults", |
| ] |
| run_test = true |
| deps = [ |
| ":libdiscod", |
| "//common-mk/testrunner", |
| ] |
| } |
| } |