| # 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 = [ |
| ":libmissiveclient_pc", |
| ":missiveclientlib", |
| ":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" ] |
| } |
| |
| generate_pkg_config("libmissiveclient_pc") { |
| name = "libmissiveclient" |
| output_name = "libmissiveclient" |
| description = "missive client library" |
| version = libbase_ver |
| requires = [] |
| requires_private = [ |
| "dbus-1", |
| "libbrillo", |
| "libchrome", |
| ] |
| defines = [ "USE_RTTI_FOR_TYPE_TAGS" ] |
| libs = [ |
| "-lmissiveclientlib", |
| "-lmissiveprotostatus", |
| "-lmissiveprotorecordconstants", |
| "-lmissiveprotorecord", |
| "-lmissiveprotointerface", |
| ] |
| cflags = [ |
| "-I/usr/include/libmissiveclient", |
| "-v", |
| ] |
| } |
| |
| # Client library for use by other daemons to call missived |
| static_library("missiveclientlib") { |
| sources = [ |
| "client/dm_token_retriever.h", |
| "client/empty_dm_token_retriever.cc", |
| "client/empty_dm_token_retriever.h", |
| "client/missive_client.cc", |
| "client/missive_client.h", |
| "client/missive_dbus_constants.h", |
| "client/report_queue.cc", |
| "client/report_queue.h", |
| "client/report_queue_configuration.cc", |
| "client/report_queue_configuration.h", |
| "client/report_queue_factory.cc", |
| "client/report_queue_factory.h", |
| "client/report_queue_impl.cc", |
| "client/report_queue_impl.h", |
| "client/report_queue_nonchrome_provider.cc", |
| "client/report_queue_provider.cc", |
| "client/report_queue_provider.h", |
| "storage/missive_storage_module.cc", |
| "storage/missive_storage_module.h", |
| "storage/missive_storage_module_delegate_impl.cc", |
| "storage/missive_storage_module_delegate_impl.h", |
| "storage/storage_module_interface.cc", |
| "storage/storage_module_interface.h", |
| "util/shared_queue.h", |
| "util/status.cc", |
| "util/status.h", |
| "util/statusor.cc", |
| "util/statusor.h", |
| ] |
| configs += [ ":target_defaults" ] |
| |
| # Make the library into a standalone one. |
| configs -= [ "//common-mk:use_thin_archive" ] |
| configs += [ "//common-mk:nouse_thin_archive" ] |
| |
| public_deps = [ |
| "//missive/proto:libmissiveprotointerface", |
| "//missive/proto:libmissiveprotorecord", |
| "//missive/proto:libmissiveprotorecordconstants", |
| ] |
| } |
| |
| 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:libmissiveprotointerface", |
| "//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:disconnectable_client", |
| "//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 = [ |
| "client/empty_dm_token_retriever_test.cc", |
| "client/report_queue_configuration_test.cc", |
| "client/report_queue_factory_test.cc", |
| "client/report_queue_impl_test.cc", |
| "client/report_queue_provider_test.cc", |
| "client/report_queue_provider_test_helper.cc", |
| "client/report_queue_provider_test_helper.h", |
| "client/report_queue_test.cc", |
| "compression/compression_module_test.cc", |
| "dbus/upload_client_test.cc", |
| "missive_daemon_test.cc", |
| "resources/resource_interface_test.cc", |
| "scheduler/enqueue_job_test.cc", |
| "scheduler/scheduler_test.cc", |
| "scheduler/upload_job_test.cc", |
| "storage/storage_queue_stress_test.cc", |
| "storage/storage_queue_test.cc", |
| "storage/storage_test.cc", |
| "util/disconnectable_client_test.cc", |
| "util/file_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/client:client_test_support", |
| "//missive/compression:compression_module", |
| "//missive/compression:compression_test_support", |
| "//missive/dbus:upload_client", |
| "//missive/encryption:encryption_test_support", |
| "//missive/encryption:unit_tests", |
| "//missive/resources:resource_interface", |
| "//missive/scheduler", |
| "//missive/scheduler:enqueue_job", |
| "//missive/scheduler:upload_job", |
| "//missive/storage:storage_test_support", |
| "//missive/storage:storage_uploader_interface", |
| "//missive/util:file", |
| "//missive/util:shared_queue", |
| "//missive/util:status", |
| "//missive/util:test_callbacks_support", |
| ] |
| } |
| } |