| # Copyright 2021 The Chromium OS 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("//common-mk/generate-dbus-adaptors.gni") |
| import("//common-mk/generate-dbus-proxies.gni") |
| import("//common-mk/pkg_config.gni") |
| import("//common-mk/proto_library.gni") |
| |
| group("all") { |
| deps = [ |
| ":install_dbus_config", |
| ":install_headers", |
| ":install_init", |
| ":spaced", |
| ":spaced_cli", |
| ] |
| |
| if (use.test) { |
| deps += [ ":libspaced_unittests" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| ] |
| } |
| |
| generate_dbus_adaptors("spaced_adaptor") { |
| dbus_service_config = "dbus_bindings/dbus-service-config.json" |
| dbus_adaptors_out_dir = "include/spaced/dbus_adaptors" |
| sources = [ "dbus_bindings/org.chromium.Spaced.xml" ] |
| } |
| |
| generate_dbus_proxies("spaced_proxy") { |
| dbus_service_config = "dbus_bindings/dbus-service-config.json" |
| proxy_output_file = "include/spaced/dbus-proxies.h" |
| mock_output_file = "include/spaced/dbus-proxy-mocks.h" |
| proxy_path_in_mocks = "spaced/dbus-proxies.h" |
| sources = [ "dbus_bindings/org.chromium.Spaced.xml" ] |
| } |
| |
| shared_library("libspaced") { |
| sources = [ |
| "disk_usage_impl.cc", |
| "disk_usage_proxy.cc", |
| ] |
| libs = [ "rootdev" ] |
| configs += [ ":target_defaults" ] |
| install_path = "lib" |
| deps = [ ":spaced_proxy" ] |
| } |
| |
| executable("spaced") { |
| sources = [ |
| "daemon.cc", |
| "main.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| install_path = "sbin" |
| deps = [ |
| ":libspaced", |
| ":spaced_adaptor", |
| ] |
| } |
| |
| executable("spaced_cli") { |
| sources = [ "cli.cc" ] |
| configs += [ ":target_defaults" ] |
| install_path = "sbin" |
| deps = [ ":libspaced" ] |
| } |
| |
| install_config("install_dbus_config") { |
| sources = [ "dbus_bindings/org.chromium.Spaced.conf" ] |
| install_path = "/etc/dbus-1/system.d" |
| } |
| |
| install_config("install_init") { |
| sources = [ "init/spaced.conf" ] |
| install_path = "/etc/init" |
| } |
| |
| install_config("install_headers") { |
| sources = [ |
| "daemon.h", |
| "disk_usage.h", |
| "disk_usage_impl.h", |
| "disk_usage_proxy.h", |
| ] |
| install_path = "/usr/include/spaced" |
| } |
| |
| if (use.test) { |
| executable("libspaced_unittests") { |
| sources = [ "disk_usage_test.cc" ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ] |
| run_test = true |
| deps = [ |
| ":libspaced", |
| "//common-mk/testrunner", |
| ] |
| } |
| } |