| # Copyright 2019 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/mojom_bindings_generator.gni") |
| import("//common-mk/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":cups_proxy", |
| ":install_dbus_config", |
| ":install_dbus_service", |
| ":install_init", |
| ":install_policy", |
| ":install_tmpfiles_config", |
| ] |
| if (use.test) { |
| deps += [ ":cups_proxy_unittest" ] |
| } |
| } |
| |
| generate_mojom_bindings("cups_proxy_mojo_bindings") { |
| mojo_root = "${platform2_root}" |
| sources = [ "mojom/proxy.mojom" ] |
| } |
| |
| pkg_config("cups_proxy_common_pkg_deps") { |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| "libmicrohttpd", |
| "libmojo", |
| ] |
| } |
| |
| static_library("cups_proxy_common") { |
| sources = [ |
| "daemon.cc", |
| "mhd_http_request.cc", |
| "mhd_util.cc", |
| "mojo_handler.cc", |
| ] |
| all_dependent_configs = [ ":cups_proxy_common_pkg_deps" ] |
| deps = [ ":cups_proxy_mojo_bindings" ] |
| } |
| |
| executable("cups_proxy") { |
| install_path = "bin" |
| sources = [ "main.cc" ] |
| deps = [ ":cups_proxy_common" ] |
| } |
| |
| if (use.test) { |
| executable("cups_proxy_unittest") { |
| run_test = true |
| sources = [ "mhd_http_request_test.cc" ] |
| configs += [ "//common-mk:test" ] |
| deps = [ |
| ":cups_proxy_common", |
| "//common-mk/testrunner:testrunner", |
| ] |
| } |
| } |
| |
| install_config("install_init") { |
| sources = [ "init/cups_proxy.conf" ] |
| install_path = "upstart" |
| } |
| |
| install_config("install_tmpfiles_config") { |
| sources = [ "tmpfiles.d/cups_proxy.conf" ] |
| install_path = "tmpfilesd" |
| } |
| |
| install_config("install_policy") { |
| _arch = getenv("ARCH") |
| sources = [ "seccomp/cups_proxy-seccomp-${_arch}.policy" ] |
| install_path = "seccomp_policy" |
| |
| outputs = [ "cups_proxy-seccomp.policy" ] |
| } |
| |
| install_config("install_dbus_config") { |
| sources = [ "dbus/org.chromium.CupsProxyDaemon.conf" ] |
| install_path = "dbus_system_d" |
| } |
| |
| install_config("install_dbus_service") { |
| sources = [ "dbus/org.chromium.CupsProxyDaemon.service" ] |
| install_path = "dbus_system_services" |
| } |