| # 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 = [ |
| ":libmessaging_layer", |
| ":missived", |
| ] |
| if (use.test) { |
| deps += [ ":missived_testrunner" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "dbus-1", |
| "libbrillo", |
| "libchrome", |
| |
| # system_api depends on protobuf(or protobuf - lite).It must appear |
| # before protobuf here or the linker flags won't be in the right |
| # order. |
| "system_api", |
| ] |
| if (use.fuzzer) { |
| pkg_deps += [ "protobuf" ] |
| } else { |
| pkg_deps += [ "protobuf-lite" ] |
| } |
| } |
| |
| generate_dbus_adaptors("missive_dbus_adaptors") { |
| dbus_adaptors_out_dir = "include/dbus_adaptors" |
| dbus_service_config = "dbus/dbus-service-config.json" |
| sources = [ "dbus/org.chromium.Missived.xml" ] |
| } |
| |
| # Used by other tools to interact with missived |
| generate_dbus_proxies("missive_dbus_proxies") { |
| dbus_service_config = "dbus/dbus-service-config.json" |
| proxy_output_file = "include/dbus_proxies/missive/dbus-proxies.h" |
| mock_output_file = "include/dbus_proxies/missive/dbus-proxies-mocks.h" |
| proxy_path_in_mocks = "missive/dbus-proxies.h" |
| sources = [ "dbus/org.chromium.Missived.xml" ] |
| } |
| |
| static_library("libmessaging_layer") { |
| sources = [ "missive_daemon.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":missive_dbus_adaptors", |
| ":missive_dbus_proxies", |
| "//missive/dbus:upload_client", |
| "//missive/encryption:encryption_module", |
| "//missive/encryption:verification", |
| "//missive/proto:interface_proto", |
| "//missive/scheduler", |
| "//missive/scheduler:enqueue_job", |
| "//missive/scheduler:upload_job", |
| "//missive/storage:storage_configuration", |
| "//missive/storage:storage_module", |
| "//missive/storage:storage_module_interface", |
| "//missive/storage:storage_uploader_interface", |
| "//missive/util:status", |
| ] |
| } |
| |
| executable("missived") { |
| sources = [ "main.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ ":libmessaging_layer" ] |
| } |
| |
| if (use.test) { |
| pkg_config("target_test") { |
| pkg_deps = [ |
| "libbrillo-test", |
| "libchrome-test", |
| "openssl", |
| ] |
| } |
| |
| executable("missived_testrunner") { |
| sources = [ |
| "compression/compression_module_test.cc", |
| "dbus/upload_client_test.cc", |
| "missive_daemon_test.cc", |
| "scheduler/enqueue_job_test.cc", |
| "scheduler/scheduler_test.cc", |
| "scheduler/upload_job_test.cc", |
| "storage/resources/resource_interface_test.cc", |
| "storage/storage_queue_stress_test.cc", |
| # "storage/storage_queue_test.cc", flakiness, disabled temporarily (b/194224371) |
| "storage/storage_test.cc", |
| "util/shared_queue_test.cc", |
| "util/status_macros_test.cc", |
| "util/status_test.cc", |
| "util/statusor_test.cc", |
| ] |
| |
| configs += [ |
| ":target_defaults", |
| ":target_test", |
| "//common-mk:test", |
| ] |
| |
| deps = [ |
| ":libmessaging_layer", |
| "//common-mk/testrunner", |
| "//missive/compression:compression_module", |
| "//missive/compression:compression_test_support", |
| "//missive/dbus:upload_client", |
| "//missive/encryption:encryption_test_support", |
| "//missive/encryption:unit_tests", |
| "//missive/scheduler", |
| "//missive/scheduler:enqueue_job", |
| "//missive/scheduler:upload_job", |
| "//missive/storage:storage_test_support", |
| "//missive/storage:storage_uploader_interface", |
| "//missive/storage/resources:resource_interface", |
| "//missive/util:shared_queue", |
| "//missive/util:status", |
| "//missive/util:test_callbacks_support", |
| ] |
| } |
| } |