blob: 864a0c6b128b68db851e92c5092c2aec69b92e48 [file] [log] [blame] [edit]
# Copyright 2018 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.
#
# BUILD.gn doesn't compile all files in the directory to reduce build size.
# Missing files can be added if needed.
import("//common-mk/mojom_bindings_generator.gni")
import("//common-mk/mojom_type_mappings_generator.gni")
import("//common-mk/pkg_config.gni")
group("all") {
deps = [
":install_basever",
":install_test_support_header",
":libchrome",
":libchrome-test",
]
if (use.mojo) {
deps += [ ":libmojo" ]
}
if (use.test) {
deps += [ ":optional_unittests" ]
}
if (use.crypto) {
deps += [ ":install_crypto_header" ]
}
}
config("libchrome_config") {
# TODO(hidehiko): Consolidate with build_config.h.
defines = [
"OS_CHROMEOS",
"USE_NSS_CERTS",
"USE_SYSTEM_LIBEVENT",
"NO_TCMALLOC",
"MOJO_BACKWARDS_COMPAT",
"MOJO_CORE_LEGACY_PROTOCOL",
]
if (use.asan) {
defines += [
"LEAK_SANITIZER",
"DISABLE_ALLOCATOR_SANITIZER",
]
}
include_dirs = [
".",
"${sysroot}/usr/include/perfetto",
]
cflags = [
"-Wno-deprecated-register",
"-Wno-narrowing",
"-Wno-unreachable-code-return",
"-Wno-unused-local-typedefs",
"-Xclang-only=-Wno-char-subscripts",
]
# Address sanitizer + coverage builds do not support -z,defs.
if (!(use.asan || use.coverage)) {
ldflags = [ "-Wl,-z,defs" ]
}
}
config("base_core_config") {
cflags = [
# Suppressing warning in base/strings/stringprintf.cc.
"-Wno-format-nonliteral",
# This is for _exit(1) in base/debug/debugger_posix.cc.
"-Wno-unreachable-code",
# For double-conversion/strtod.cc
"-Wno-unused-function",
]
}
config("base_export_config") {
defines = [
"COMPONENT_BUILD",
"BASE_IMPLEMENTATION",
]
}
config("crypto_export_config") {
defines = [
"COMPONENT_BUILD",
"CRYPTO_IMPLEMENTATION",
]
}
config("dbus_export_config") {
defines = [
"COMPONENT_BUILD",
"DBUS_IMPLEMENTATION",
]
}
config("policy_export_config") {
defines = [
"COMPONENT_BUILD",
"POLICY_COMPONENT_IMPLEMENTATION",
]
}
config("mojo_export_config") {
defines = [ "COMPONENT_BUILD" ]
}
libbase_sublibs = [
{
name = "base-core"
libs = [
"dl",
"double-conversion",
"pthread",
"rt",
"modp_b64",
]
pkg_deps = [
"absl",
"glib-2.0",
"libevent",
]
configs = [
":base_core_config",
":base_export_config",
]
sources = [
"base/at_exit.cc",
"base/barrier_closure.cc",
"base/base64.cc",
"base/base64url.cc",
"base/base_paths.cc",
"base/base_paths_posix.cc",
"base/base_switches.cc",
"base/big_endian.cc",
"base/build_time.cc",
"base/callback_helpers.cc",
"base/callback_internal.cc",
"base/callback_list.cc",
"base/check.cc",
"base/check_op.cc",
"base/command_line.cc",
"base/containers/intrusive_heap.cc",
"base/containers/linked_list.cc",
"base/cpu.cc",
"base/cpu_reduction_experiment.cc",
"base/debug/activity_tracker.cc",
"base/debug/alias.cc",
"base/debug/crash_logging.cc",
"base/debug/debugger.cc",
"base/debug/debugger_posix.cc",
"base/debug/dump_without_crashing.cc",
"base/debug/stack_trace.cc",
"base/debug/stack_trace_posix.cc",
"base/debug/task_trace.cc",
"base/environment.cc",
"base/feature_list.cc",
"base/file_descriptor_posix.cc",
"base/files/file.cc",
"base/files/file_descriptor_watcher_posix.cc",
"base/files/file_enumerator.cc",
"base/files/file_enumerator_posix.cc",
"base/files/file_path.cc",
"base/files/file_path_watcher.cc",
"base/files/file_path_watcher_inotify.cc",
"base/files/file_posix.cc",
"base/files/file_tracing.cc",
"base/files/file_util.cc",
"base/files/file_util_linux.cc",
"base/files/file_util_posix.cc",
"base/files/important_file_writer.cc",
"base/files/important_file_writer_cleaner.cc",
"base/files/memory_mapped_file.cc",
"base/files/memory_mapped_file_posix.cc",
"base/files/scoped_file.cc",
"base/files/scoped_file_linux.cc",
"base/files/scoped_temp_dir.cc",
"base/guid.cc",
"base/hash/hash.cc",
"base/hash/md5.cc",
"base/hash/sha1.cc",
"base/json/json_file_value_serializer.cc",
"base/json/json_parser.cc",
"base/json/json_reader.cc",
"base/json/json_string_value_serializer.cc",
"base/json/json_value_converter.cc",
"base/json/json_writer.cc",
"base/json/string_escape.cc",
"base/json/values_util.cc",
"base/lazy_instance_helpers.cc",
"base/location.cc",
"base/logging.cc",
"base/logging_chromeos.cc",
"base/memory/aligned_memory.cc",
"base/memory/memory_pressure_listener.cc",
"base/memory/nonscannable_memory.cc",
"base/memory/page_size_posix.cc",
"base/memory/platform_shared_memory_region.cc",
"base/memory/platform_shared_memory_region_posix.cc",
"base/memory/read_only_shared_memory_region.cc",
"base/memory/ref_counted.cc",
"base/memory/ref_counted_memory.cc",
"base/memory/shared_memory_mapping.cc",
"base/memory/shared_memory_security_policy.cc",
"base/memory/shared_memory_tracker.cc",
"base/memory/unsafe_shared_memory_region.cc",
"base/memory/weak_ptr.cc",
"base/memory/writable_shared_memory_region.cc",
"base/message_loop/message_pump.cc",
"base/message_loop/message_pump_default.cc",
"base/message_loop/message_pump_glib.cc",
"base/message_loop/message_pump_libevent.cc",
"base/message_loop/watchable_io_message_pump_posix.cc",
"base/message_loop/work_id_provider.cc",
"base/metrics/bucket_ranges.cc",
"base/metrics/crc32.cc",
"base/metrics/dummy_histogram.cc",
"base/metrics/field_trial.cc",
"base/metrics/field_trial_param_associator.cc",
"base/metrics/field_trial_params.cc",
"base/metrics/histogram.cc",
"base/metrics/histogram_base.cc",
"base/metrics/histogram_functions.cc",
"base/metrics/histogram_samples.cc",
"base/metrics/histogram_snapshot_manager.cc",
"base/metrics/metrics_hashes.cc",
"base/metrics/persistent_histogram_allocator.cc",
"base/metrics/persistent_memory_allocator.cc",
"base/metrics/persistent_sample_map.cc",
"base/metrics/ranges_manager.cc",
"base/metrics/sample_map.cc",
"base/metrics/sample_vector.cc",
"base/metrics/sparse_histogram.cc",
"base/metrics/statistics_recorder.cc",
"base/native_library.cc",
"base/native_library_posix.cc",
"base/notreached.cc",
"base/observer_list_internal.cc",
"base/observer_list_threadsafe.cc",
"base/observer_list_types.cc",
"base/path_service.cc",
"base/pending_task.cc",
"base/pickle.cc",
"base/posix/can_lower_nice_to.cc",
"base/posix/file_descriptor_shuffle.cc",
"base/posix/global_descriptors.cc",
"base/posix/safe_strerror.cc",
"base/posix/unix_domain_socket.cc",
"base/power_monitor/power_monitor.cc",
"base/power_monitor/power_monitor_device_source.cc",
"base/power_monitor/power_monitor_device_source_chromeos.cc",
"base/power_monitor/power_monitor_source.cc",
"base/process/environment_internal.cc",
"base/process/internal_linux.cc",
"base/process/kill.cc",
"base/process/kill_posix.cc",
"base/process/launch.cc",
"base/process/launch_posix.cc",
"base/process/memory.cc",
"base/process/memory_linux.cc",
"base/process/process_handle.cc",
"base/process/process_handle_linux.cc",
"base/process/process_handle_posix.cc",
"base/process/process_iterator.cc",
"base/process/process_iterator_linux.cc",
"base/process/process_linux.cc",
"base/process/process_metrics.cc",
"base/process/process_metrics_linux.cc",
"base/process/process_metrics_posix.cc",
"base/process/process_posix.cc",
"base/profiler/metadata_recorder.cc",
"base/profiler/sample_metadata.cc",
"base/profiler/stack_buffer.cc",
"base/profiler/stack_sampler.cc",
"base/profiler/stack_sampler_posix.cc",
"base/profiler/stack_sampling_profiler.cc",
"base/rand_util.cc",
"base/rand_util_posix.cc",
"base/run_loop.cc",
"base/scoped_native_library.cc",
"base/sequence_checker.cc",
"base/sequence_checker_impl.cc",
"base/sequence_token.cc",
"base/strings/escape.cc",
"base/strings/pattern.cc",
"base/strings/safe_sprintf.cc",
"base/strings/strcat.cc",
"base/strings/string_number_conversions.cc",
"base/strings/string_piece.cc",
"base/strings/string_split.cc",
"base/strings/string_util.cc",
"base/strings/string_util_constants.cc",
"base/strings/stringprintf.cc",
"base/strings/sys_string_conversions_posix.cc",
"base/strings/utf_offset_string_conversions.cc",
"base/strings/utf_string_conversion_utils.cc",
"base/strings/utf_string_conversions.cc",
"base/sync_socket.cc",
"base/sync_socket_posix.cc",
"base/synchronization/atomic_flag.cc",
"base/synchronization/condition_variable_posix.cc",
"base/synchronization/lock.cc",
"base/synchronization/lock_impl_posix.cc",
"base/synchronization/waitable_event_posix.cc",
"base/synchronization/waitable_event_watcher_posix.cc",
"base/system/sys_info.cc",
"base/system/sys_info_chromeos.cc",
"base/system/sys_info_linux.cc",
"base/system/sys_info_posix.cc",
"base/task/cancelable_task_tracker.cc",
"base/task/common/checked_lock_impl.cc",
"base/task/common/operations_controller.cc",
"base/task/common/scoped_defer_task_posting.cc",
"base/task/common/task_annotator.cc",
"base/task/current_thread.cc",
"base/task/default_delayed_task_handle_delegate.cc",
"base/task/delayed_task_handle.cc",
"base/task/lazy_thread_pool_task_runner.cc",
"base/task/post_task.cc",
"base/task/scoped_set_task_priority_for_current_thread.cc",
"base/task/sequence_manager/associated_thread_id.cc",
"base/task/sequence_manager/atomic_flag_set.cc",
"base/task/sequence_manager/delayed_task_handle_delegate.cc",
"base/task/sequence_manager/enqueue_order_generator.cc",
"base/task/sequence_manager/fence.cc",
"base/task/sequence_manager/lazy_now.cc",
"base/task/sequence_manager/sequence_manager.cc",
"base/task/sequence_manager/sequence_manager_impl.cc",
"base/task/sequence_manager/sequenced_task_source.cc",
"base/task/sequence_manager/task_order.cc",
"base/task/sequence_manager/task_queue.cc",
"base/task/sequence_manager/task_queue_impl.cc",
"base/task/sequence_manager/task_queue_selector.cc",
"base/task/sequence_manager/tasks.cc",
"base/task/sequence_manager/thread_controller.cc",
"base/task/sequence_manager/thread_controller_impl.cc",
"base/task/sequence_manager/thread_controller_power_monitor.cc",
"base/task/sequence_manager/thread_controller_with_message_pump_impl.cc",
"base/task/sequence_manager/time_domain.cc",
"base/task/sequence_manager/wake_up_queue.cc",
"base/task/sequence_manager/work_deduplicator.cc",
"base/task/sequence_manager/work_queue.cc",
"base/task/sequence_manager/work_queue_sets.cc",
"base/task/sequenced_task_runner.cc",
"base/task/simple_task_executor.cc",
"base/task/single_thread_task_executor.cc",
"base/task/task_executor.cc",
"base/task/task_features.cc",
"base/task/task_runner.cc",
"base/task/task_traits.cc",
"base/task/thread_pool.cc",
"base/task/thread_pool/delayed_task_manager.cc",
"base/task/thread_pool/environment_config.cc",
"base/task/thread_pool/pooled_parallel_task_runner.cc",
"base/task/thread_pool/pooled_sequenced_task_runner.cc",
"base/task/thread_pool/pooled_single_thread_task_runner_manager.cc",
"base/task/thread_pool/pooled_task_runner_delegate.cc",
"base/task/thread_pool/priority_queue.cc",
"base/task/thread_pool/sequence.cc",
"base/task/thread_pool/service_thread.cc",
"base/task/thread_pool/task.cc",
"base/task/thread_pool/task_source.cc",
"base/task/thread_pool/task_source_sort_key.cc",
"base/task/thread_pool/task_tracker.cc",
"base/task/thread_pool/task_tracker_posix.cc",
"base/task/thread_pool/thread_group.cc",
"base/task/thread_pool/thread_group_impl.cc",
"base/task/thread_pool/thread_pool_impl.cc",
"base/task/thread_pool/thread_pool_instance.cc",
"base/task/thread_pool/worker_thread.cc",
"base/task/thread_pool/worker_thread_stack.cc",
"base/third_party/dynamic_annotations/dynamic_annotations.c",
"base/third_party/nspr/prtime.cc",
"base/threading/hang_watcher.cc",
"base/threading/platform_thread.cc",
"base/threading/platform_thread_internal_posix.cc",
"base/threading/platform_thread_linux.cc",
"base/threading/platform_thread_posix.cc",
"base/threading/platform_thread_ref.cc",
"base/threading/post_task_and_reply_impl.cc",
"base/threading/scoped_blocking_call.cc",
"base/threading/scoped_blocking_call_internal.cc",
"base/threading/sequence_local_storage_map.cc",
"base/threading/sequence_local_storage_slot.cc",
"base/threading/sequenced_task_runner_handle.cc",
"base/threading/simple_thread.cc",
"base/threading/thread.cc",
"base/threading/thread_checker.cc",
"base/threading/thread_checker_impl.cc",
"base/threading/thread_collision_warner.cc",
"base/threading/thread_id_name_manager.cc",
"base/threading/thread_local_storage.cc",
"base/threading/thread_local_storage_posix.cc",
"base/threading/thread_restrictions.cc",
"base/threading/thread_task_runner_handle.cc",
"base/time/clock.cc",
"base/time/default_clock.cc",
"base/time/default_tick_clock.cc",
"base/time/tick_clock.cc",
"base/time/time.cc",
"base/time/time_conversion_posix.cc",
"base/time/time_delta_from_string.cc",
"base/time/time_exploded_posix.cc",
"base/time/time_now_posix.cc",
"base/time/time_override.cc",
"base/timer/elapsed_timer.cc",
"base/timer/lap_timer.cc",
"base/timer/timer.cc",
"base/timer/wall_clock_timer.cc",
"base/token.cc",
"base/trace_event/heap_profiler_allocation_context_tracker.cc",
"base/trace_event/memory_allocator_dump_guid.cc",
"base/trace_event/trace_event_stub.cc",
"base/trace_event/trace_id_helper.cc",
"base/unguessable_token.cc",
"base/value_iterators.cc",
"base/values.cc",
"base/version.cc",
"base/vlog.cc",
]
# Enable //base/allocator shim for non-sanitizer builds.
if (!(use.asan || use.fuzzer || use.msan || use.ubsan)) {
sources += [
"base/allocator/allocator_extension.cc",
"base/allocator/allocator_shim.cc",
"base/allocator/allocator_shim_default_dispatch_to_glibc.cc",
]
}
},
{
name = "base-policy"
deps = [ ":base-core" ]
libs = [ "re2" ]
configs = [ ":policy_export_config" ]
sources = [
"components/policy/core/common/json_schema_constants.cc",
"components/policy/core/common/policy_load_status.cc",
"components/policy/core/common/registry_dict.cc",
"components/policy/core/common/schema.cc",
]
},
{
name = "base-base_test_support"
testonly = true
sources = [
"base/test/mock_entropy_provider.cc",
"base/test/scoped_chromeos_version_info.cc",
"base/test/scoped_feature_list.cc",
"base/test/scoped_run_loop_timeout.cc",
"base/test/simple_test_clock.cc",
"base/test/simple_test_tick_clock.cc",
"base/test/task_environment.cc",
"base/test/test_file_util.cc",
"base/test/test_file_util_linux.cc",
"base/test/test_file_util_posix.cc",
"base/test/test_mock_time_task_runner.cc",
"base/test/test_pending_task.cc",
"base/test/test_simple_task_runner.cc",
"base/test/test_switches.cc",
"base/test/test_timeouts.cc",
]
},
]
if (use.crypto) {
libbase_sublibs += [
{
name = "base-crypto"
deps = [ ":base-core" ]
libs = [
"dl",
"pthread",
]
pkg_deps = [
"nss",
"openssl",
]
configs = [ ":crypto_export_config" ]
sources = [
"crypto/hmac.cc",
"crypto/hmac_nss.cc",
# Added to libchrome only (not upstream) to support OpenSSL 1.1 API
"crypto/libcrypto-compat.c",
"crypto/nss_key_util.cc",
"crypto/nss_util.cc",
"crypto/openssl_util.cc",
"crypto/p224.cc",
"crypto/p224_spake.cc",
"crypto/random.cc",
"crypto/rsa_private_key.cc",
"crypto/rsa_private_key_nss.cc",
"crypto/scoped_test_nss_db.cc",
"crypto/secure_hash.cc",
"crypto/secure_util.cc",
"crypto/sha2.cc",
"crypto/signature_creator_nss.cc",
"crypto/signature_verifier_nss.cc",
"crypto/symmetric_key_nss.cc",
"crypto/third_party/nss/rsawrapr.c",
"crypto/third_party/nss/sha512.cc",
]
},
]
}
if (use.dbus) {
libbase_sublibs += [
{
name = "base-dbus"
deps = [ ":base-core" ]
pkg_deps = [
"absl",
"dbus-1",
]
if (use.fuzzer) {
pkg_deps += [ "protobuf" ]
} else {
pkg_deps += [ "protobuf-lite" ]
}
configs = [ ":dbus_export_config" ]
sources = [
"dbus/bus.cc",
"dbus/dbus_statistics.cc",
"dbus/exported_object.cc",
"dbus/message.cc",
"dbus/object_manager.cc",
"dbus/object_path.cc",
"dbus/object_proxy.cc",
"dbus/property.cc",
"dbus/scoped_dbus_error.cc",
"dbus/string_util.cc",
"dbus/util.cc",
"dbus/values_util.cc",
]
},
{
name = "base-dbus_test_support"
testonly = true
pkg_deps = [ "dbus-1" ]
if (use.fuzzer) {
pkg_deps += [ "protobuf" ]
} else {
pkg_deps += [ "protobuf-lite" ]
}
sources = [
"dbus/mock_bus.cc",
"dbus/mock_exported_object.cc",
"dbus/mock_object_manager.cc",
"dbus/mock_object_proxy.cc",
]
},
]
}
# Generate static/shared libraries.
foreach(attr, libbase_sublibs) {
if (defined(attr.pkg_deps)) {
# If it depends on external packages, introduces -pkg-config config.
pkg_config(attr.name + "-pkg-config") {
pkg_deps = attr.pkg_deps
}
}
if (defined(attr.testonly) && attr.testonly) {
buildtype = "static_library"
} else {
buildtype = "shared_library"
}
target(buildtype, attr.name) {
sources = attr.sources
if (defined(attr.deps)) {
deps = attr.deps
}
if (defined(attr.libs)) {
libs = attr.libs
}
if (defined(attr.pkg_deps)) {
configs += [ ":" + attr.name + "-pkg-config" ]
}
configs += [ ":libchrome_config" ]
if (buildtype == "static_library") {
configs -= [ "//common-mk:use_thin_archive" ]
configs += [ "//common-mk:nouse_thin_archive" ]
}
if (defined(attr.configs)) {
configs += attr.configs
}
}
}
action("base") {
deps = []
foreach(attr, libbase_sublibs) {
if (!defined(attr.testonly) || !attr.testonly) {
deps += [ ":" + attr.name ]
}
}
script = "//common-mk/write_args.py"
outputs = [ "${root_out_dir}/lib/lib${target_name}.so" ]
args = [ "--output" ] + outputs + [ "--" ] + [
"GROUP",
"(",
"AS_NEEDED",
"(",
]
foreach(attr, libbase_sublibs) {
if (!defined(attr.testonly) || !attr.testonly) {
args += [ "-l" + attr.name ]
}
}
args += [
")",
")",
]
}
libchrome_exported_cflags = [
"-I/usr/include/libchrome",
"-I/usr/include/perfetto",
"-Wno-unused-local-typedefs",
"-DBASE_VER=${libbase_ver}",
]
if (use.asan) {
libchrome_exported_cflags += [
"-DLEAK_SANITIZER",
"-DDISABLE_ALLOCATOR_SANITIZER",
]
}
generate_pkg_config("libchrome") {
deps = [ ":base" ]
description = "chrome base library"
version = "${libbase_ver}"
requires_private = []
foreach(attr, libbase_sublibs) {
if ((!defined(attr.testonly) || !attr.testonly) && defined(attr.pkg_deps)) {
requires_private += attr.pkg_deps
}
}
# base/synchronization/lock_impl.h has function inlined that uses pthread.
libs = [
"-lbase",
"-lpthread",
]
libs_private = []
foreach(attr, libbase_sublibs) {
if (!defined(attr.testonly) || !attr.testonly) {
libs_private += [ "-l" + attr.name ]
if (defined(attr.libs)) {
foreach(lib, attr.libs) {
libs_private += [ "-l" + lib ]
}
}
}
}
cflags = libchrome_exported_cflags
}
action("base-test") {
deps = []
foreach(attr, libbase_sublibs) {
if (defined(attr.testonly) && attr.testonly) {
deps += [ ":" + attr.name ]
}
}
script = "//common-mk/write_args.py"
outputs = [ "${root_out_dir}/lib${target_name}.a" ]
args = [ "--output" ] + outputs + [ "--" ] + [
"GROUP",
"(",
"AS_NEEDED",
"(",
]
foreach(attr, libbase_sublibs) {
if (defined(attr.testonly) && attr.testonly) {
args += [ "-l" + attr.name ]
}
}
args += [
")",
")",
]
}
generate_pkg_config("libchrome-test") {
deps = [ ":base-test" ]
description = "chrome base test library"
version = "${libbase_ver}"
requires_private = []
foreach(attr, libbase_sublibs) {
if (defined(attr.testonly) && attr.testonly && defined(attr.pkg_deps)) {
requires_private += attr.pkg_deps
}
}
libs = [ "-lbase-test" ]
libs_private = []
foreach(attr, libbase_sublibs) {
if (defined(attr.testonly) && attr.testonly) {
libs_private += [ "-l" + attr.name ]
if (defined(attr.libs)) {
libs_private += [ "-l" + lib ]
}
}
}
cflags = libchrome_exported_cflags
}
if (use.mojo) {
generate_mojom_type_mappings("mojom_type_mappings") {
mojom_type_mappings_generator =
"libchrome_tools/mojom_generate_type_mappings.py"
sources = [
"mojo/public/cpp/base/file.typemap",
"mojo/public/cpp/base/file_error.typemap",
"mojo/public/cpp/base/file_info.typemap",
"mojo/public/cpp/base/file_path.typemap",
"mojo/public/cpp/base/memory_allocator_dump_cross_process_uid.typemap",
"mojo/public/cpp/base/process_id.typemap",
"mojo/public/cpp/base/read_only_buffer.typemap",
"mojo/public/cpp/base/shared_memory.typemap",
"mojo/public/cpp/base/text_direction.typemap",
"mojo/public/cpp/base/thread_priority.typemap",
"mojo/public/cpp/base/time.typemap",
"mojo/public/cpp/base/unguessable_token.typemap",
"mojo/public/cpp/base/values.typemap",
]
}
generate_mojom_bindings_gen("mojom_bindings_gen") {
mojom_bindings_generator =
"mojo/public/tools/bindings/mojom_bindings_generator.py"
mojom_parser = "mojo/public/tools/mojom/mojom_parser.py"
# TODO(fqj): revisit typemaps after uprev.
# typemaps = get_target_outputs(":mojom_type_mappings")
sources = [
"ipc/ipc.mojom",
# TODO(fqj): Revisit these 3 files after uprev.
"mojo/public/interfaces/bindings/interface_control_messages.mojom",
"mojo/public/interfaces/bindings/native_struct.mojom",
"mojo/public/interfaces/bindings/pipe_control_messages.mojom",
"mojo/public/mojom/base/file.mojom",
"mojo/public/mojom/base/file_error.mojom",
"mojo/public/mojom/base/file_info.mojom",
"mojo/public/mojom/base/file_path.mojom",
"mojo/public/mojom/base/generic_pending_associated_receiver.mojom",
"mojo/public/mojom/base/generic_pending_receiver.mojom",
"mojo/public/mojom/base/memory_allocator_dump_cross_process_uid.mojom",
"mojo/public/mojom/base/process_id.mojom",
"mojo/public/mojom/base/read_only_buffer.mojom",
"mojo/public/mojom/base/shared_memory.mojom",
"mojo/public/mojom/base/text_direction.mojom",
"mojo/public/mojom/base/thread_priority.mojom",
"mojo/public/mojom/base/time.mojom",
"mojo/public/mojom/base/unguessable_token.mojom",
"mojo/public/mojom/base/values.mojom",
"ui/gfx/geometry/mojom/geometry.mojom",
"ui/gfx/range/mojom/range.mojom",
]
}
# TODO(fqj): Revisit these 3 files after uprev.
# generate_mojom_bindings_gen("mojom_bindings_native_gen") {
# mojom_bindings_generator =
# "mojo/public/tools/bindings/mojom_bindings_generator.py"
# mojom_parser = "mojo/public/tools/mojom/mojom_parser.py"
# sources = [
# ]
# disallow_native_types = true
# disallow_interfaces = true
# }
# Probably we should consider build libmojo as a part of libchrome.
# crbug.com/924035.
shared_library("mojo") {
deps = [
":base-core",
":base-crypto",
":mojom_bindings_gen",
# ":mojom_bindings_native_gen",
# ":mojom_type_mappings",
]
libs = [ "pthread" ]
# TODO(hidehiko): Consolidate with build_config.h.
configs += [
":libchrome_config",
":mojo_export_config",
"//common-mk:visibility_default",
]
sources =
[
"ipc/ipc_message.cc",
"ipc/ipc_message_attachment_set.cc",
"ipc/native_handle_type_converters.cc",
"mojo/core/atomic_flag.cc",
"mojo/core/broker_host.cc",
"mojo/core/broker_posix.cc",
"mojo/core/channel.cc",
"mojo/core/channel_linux.cc",
"mojo/core/channel_posix.cc",
"mojo/core/configuration.cc",
"mojo/core/connection_params.cc",
"mojo/core/core.cc",
"mojo/core/data_pipe_consumer_dispatcher.cc",
"mojo/core/data_pipe_control_message.cc",
"mojo/core/data_pipe_producer_dispatcher.cc",
"mojo/core/dispatcher.cc",
"mojo/core/embedder/embedder.cc",
"mojo/core/embedder/features.cc",
"mojo/core/embedder/scoped_ipc_support.cc",
"mojo/core/entrypoints.cc",
"mojo/core/handle_table.cc",
"mojo/core/invitation_dispatcher.cc",
"mojo/core/message_pipe_dispatcher.cc",
"mojo/core/mojo_core.cc",
"mojo/core/node_channel.cc",
"mojo/core/node_controller.cc",
"mojo/core/platform_handle_dispatcher.cc",
"mojo/core/platform_handle_in_transit.cc",
"mojo/core/platform_handle_utils.cc",
"mojo/core/platform_shared_memory_mapping.cc",
"mojo/core/ports/event.cc",
"mojo/core/ports/message_queue.cc",
"mojo/core/ports/name.cc",
"mojo/core/ports/node.cc",
"mojo/core/ports/port.cc",
"mojo/core/ports/port_locker.cc",
"mojo/core/ports/port_ref.cc",
"mojo/core/ports/user_message.cc",
"mojo/core/request_context.cc",
"mojo/core/shared_buffer_dispatcher.cc",
"mojo/core/user_message_impl.cc",
"mojo/core/watch.cc",
"mojo/core/watcher_dispatcher.cc",
"mojo/core/watcher_set.cc",
"mojo/public/c/system/thunks.cc",
"mojo/public/cpp/base/file_info_mojom_traits.cc",
"mojo/public/cpp/base/file_mojom_traits.cc",
"mojo/public/cpp/base/file_path_mojom_traits.cc",
"mojo/public/cpp/base/process_id_mojom_traits.cc",
"mojo/public/cpp/base/read_only_buffer_mojom_traits.cc",
"mojo/public/cpp/base/shared_memory_mojom_traits.cc",
"mojo/public/cpp/base/text_direction_mojom_traits.cc",
"mojo/public/cpp/base/thread_priority_mojom_traits.cc",
"mojo/public/cpp/base/time_mojom_traits.cc",
"mojo/public/cpp/base/unguessable_token_mojom_traits.cc",
"mojo/public/cpp/base/values_mojom_traits.cc",
"mojo/public/cpp/bindings/async_flusher.cc",
"mojo/public/cpp/bindings/connection_group.cc",
"mojo/public/cpp/bindings/features.cc",
"mojo/public/cpp/bindings/receiver_set.cc",
"mojo/public/cpp/bindings/lib/array_internal.cc",
"mojo/public/cpp/bindings/lib/associated_group.cc",
"mojo/public/cpp/bindings/lib/associated_group_controller.cc",
"mojo/public/cpp/bindings/lib/associated_interface_ptr_state.cc",
"mojo/public/cpp/bindings/lib/associated_receiver.cc",
"mojo/public/cpp/bindings/lib/binding_state.cc",
"mojo/public/cpp/bindings/lib/buffer.cc",
"mojo/public/cpp/bindings/lib/connector.cc",
"mojo/public/cpp/bindings/lib/control_message_handler.cc",
"mojo/public/cpp/bindings/lib/control_message_proxy.cc",
"mojo/public/cpp/bindings/lib/generated_code_util.cc",
"mojo/public/cpp/bindings/lib/handle_serialization.cc",
"mojo/public/cpp/bindings/lib/interface_endpoint_client.cc",
"mojo/public/cpp/bindings/lib/interface_ptr_state.cc",
"mojo/public/cpp/bindings/lib/message.cc",
"mojo/public/cpp/bindings/lib/message_dispatcher.cc",
"mojo/public/cpp/bindings/lib/message_dumper.cc",
"mojo/public/cpp/bindings/lib/message_header_validator.cc",
"mojo/public/cpp/bindings/lib/message_internal.cc",
"mojo/public/cpp/bindings/lib/message_quota_checker.cc",
"mojo/public/cpp/bindings/lib/multiplex_router.cc",
"mojo/public/cpp/bindings/lib/pending_receiver_state.cc",
"mojo/public/cpp/bindings/lib/pending_remote_state.cc",
"mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc",
"mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc",
"mojo/public/cpp/bindings/lib/proxy_to_responder.cc",
"mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.cc",
"mojo/public/cpp/bindings/lib/sequence_local_sync_event_watcher.cc",
"mojo/public/cpp/bindings/lib/send_message_helper.cc",
"mojo/public/cpp/bindings/lib/sync_call_restrictions.cc",
"mojo/public/cpp/bindings/lib/sync_event_watcher.cc",
"mojo/public/cpp/bindings/lib/sync_handle_registry.cc",
"mojo/public/cpp/bindings/lib/sync_handle_watcher.cc",
"mojo/public/cpp/bindings/lib/task_runner_helper.cc",
"mojo/public/cpp/bindings/lib/thread_safe_forwarder_base.cc",
"mojo/public/cpp/bindings/lib/unserialized_message_context.cc",
"mojo/public/cpp/bindings/lib/validation_context.cc",
"mojo/public/cpp/bindings/lib/validation_errors.cc",
"mojo/public/cpp/bindings/lib/validation_util.cc",
"mojo/public/cpp/bindings/pending_flush.cc",
"mojo/public/cpp/platform/named_platform_channel.cc",
"mojo/public/cpp/platform/named_platform_channel_posix.cc",
"mojo/public/cpp/platform/platform_channel.cc",
"mojo/public/cpp/platform/platform_channel_endpoint.cc",
"mojo/public/cpp/platform/platform_channel_server_endpoint.cc",
"mojo/public/cpp/platform/platform_handle.cc",
"mojo/public/cpp/platform/socket_utils_posix.cc",
"mojo/public/cpp/system/data_pipe_drainer.cc",
"mojo/public/cpp/system/data_pipe_producer.cc",
"mojo/public/cpp/system/data_pipe_utils.cc",
"mojo/public/cpp/system/file_data_source.cc",
"mojo/public/cpp/system/filtered_data_source.cc",
"mojo/public/cpp/system/handle_signal_tracker.cc",
"mojo/public/cpp/system/invitation.cc",
"mojo/public/cpp/system/isolated_connection.cc",
"mojo/public/cpp/system/message_pipe.cc",
"mojo/public/cpp/system/platform_handle.cc",
"mojo/public/cpp/system/scope_to_message_pipe.cc",
"mojo/public/cpp/system/simple_watcher.cc",
"mojo/public/cpp/system/string_data_source.cc",
"mojo/public/cpp/system/trap.cc",
"mojo/public/cpp/system/wait.cc",
"mojo/public/cpp/system/wait_set.cc",
] + get_target_outputs(":mojom_bindings_gen") # +
#get_target_outputs(":mojom_bindings_native_gen")
}
generate_pkg_config("libmojo") {
deps = [ ":mojo" ]
description = "Chrome Mojo IPC library"
version = "${libbase_ver}"
libs = [ "-lmojo" ]
cflags = [
"-I/usr/include/libchrome",
"-Wno-cast-qual",
"-Wno-cast-align",
]
}
}
if (use.test) {
executable("optional_unittests") {
sources = [
"base/optional_unittest.cc",
"base/test/gtest_util.cc",
]
configs += [
"//common-mk:test",
":libchrome_config",
]
libs = [ "gtest_main" ]
deps = [
":base-core",
"//common-mk/testrunner:testrunner",
]
}
}
install_config("install_basever") {
sources = [ "BASE_VER" ]
install_path = "/usr/share/libchrome"
}
install_config("install_crypto_header") {
sources = [
"crypto/crypto_export.h",
"crypto/hmac.h",
"crypto/libcrypto-compat.h",
"crypto/nss_key_util.h",
"crypto/nss_util.h",
"crypto/nss_util_internal.h",
"crypto/openssl_util.h",
"crypto/p224.h",
"crypto/p224_spake.h",
"crypto/random.h",
"crypto/rsa_private_key.h",
"crypto/scoped_nss_types.h",
"crypto/scoped_openssl_types.h",
"crypto/scoped_test_nss_db.h",
"crypto/secure_hash.h",
"crypto/secure_util.h",
"crypto/sha2.h",
"crypto/signature_creator.h",
"crypto/signature_verifier.h",
]
install_path = "/usr/include/libchrome/crypto"
}
install_config("install_test_support_header") {
sources = [
"base/test/bind.h",
"base/test/mock_callback.h",
"base/test/scoped_chromeos_version_info.h",
"base/test/scoped_feature_list.h",
"base/test/scoped_run_loop_timeout.h",
"base/test/scoped_running_on_chromeos.h",
"base/test/simple_test_clock.h",
"base/test/simple_test_tick_clock.h",
"base/test/task_environment.h",
"base/test/test_file_util.h",
"base/test/test_future.h",
"base/test/test_mock_time_task_runner.h",
"base/test/test_pending_task.h",
"base/test/test_switches.h",
"base/test/test_timeouts.h",
]
install_path = "/usr/include/libchrome/base/test"
}