blob: 454564e54c60f9e30c7df0c2197bee828badafc8 [file] [log] [blame]
# 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 = [
":libchrome",
":libchrome-test",
]
if (use.mojo) {
deps += [ ":libmojo" ]
}
}
config("libchrome_config") {
# TODO(hidehiko): Consolidate with build_config.h.
defines = [
"OS_CHROMEOS",
"USE_NSS_CERTS",
"USE_SYSTEM_LIBEVENT",
"NO_TCMALLOC",
"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 = [
"double-conversion",
"pthread",
"rt",
"modp_b64",
]
pkg_deps = [
"absl",
"glib-2.0",
"libevent",
]
configs = [ ":base_core_config", ":base_export_config" ]
sources = [
"base/allocator/allocator_extension.cc",
"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/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/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_constants.cc",
"base/files/file_path_watcher.cc",
"base/files/file_path_watcher_linux.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/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/sample_map.cc",
"base/metrics/sample_vector.cc",
"base/metrics/sparse_histogram.cc",
"base/metrics/statistics_recorder.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_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/rand_util.cc",
"base/rand_util_posix.cc",
"base/run_loop.cc",
"base/sequence_checker_impl.cc",
"base/sequence_token.cc",
"base/sequenced_task_runner.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/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/enqueue_order_generator.cc",
"base/task/sequence_manager/lazy_now.cc",
"base/task/sequence_manager/real_time_domain.cc",
"base/task/sequence_manager/sequence_manager.cc",
"base/task/sequence_manager/sequence_manager_impl.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/work_deduplicator.cc",
"base/task/sequence_manager/work_queue.cc",
"base/task/sequence_manager/work_queue_sets.cc",
"base/task/simple_task_executor.cc",
"base/task/task_executor.cc",
"base/task/task_features.cc",
"base/task/task_traits.cc",
"base/task/single_thread_task_executor.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/task_runner.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/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_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/token.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",
]
},
{
name = "base-dl"
deps = [ ":base-core" ]
libs = [ "dl" ]
configs = [ ":base_export_config" ]
sources = [
"base/allocator/allocator_shim.cc",
"base/allocator/allocator_shim_default_dispatch_to_glibc.cc",
"base/native_library.cc",
"base/native_library_posix.cc",
"base/scoped_native_library.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/scoped_chromeos_version_info.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_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",
":base-dl",
]
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/big_buffer.typemap",
"mojo/public/cpp/base/big_string.typemap",
"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/ref_counted_memory.typemap",
"mojo/public/cpp/base/shared_memory.typemap",
"mojo/public/cpp/base/string16.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/big_buffer.mojom",
"mojo/public/mojom/base/big_string.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/ref_counted_memory.mojom",
"mojo/public/mojom/base/shared_memory.mojom",
"mojo/public/mojom/base/string16.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",
":base-dl",
":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.cc",
"ipc/ipc_message_attachment_set.cc",
"ipc/ipc_message_utils.cc",
"ipc/ipc_mojo_handle_attachment.cc",
"ipc/ipc_mojo_message_helper.cc",
"ipc/ipc_mojo_param_traits.cc",
"ipc/ipc_platform_file_attachment_posix.cc",
"ipc/native_handle_type_converters.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/big_buffer.cc",
"mojo/public/cpp/base/big_buffer_mojom_traits.cc",
"mojo/public/cpp/base/big_string_mojom_traits.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/ref_counted_memory_mojom_traits.cc",
"mojo/public/cpp/base/shared_memory_mojom_traits.cc",
"mojo/public/cpp/base/string16_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/native_struct_serialization.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/scoped_interface_endpoint_handle.cc",
"mojo/public/cpp/bindings/lib/sequence_local_sync_event_watcher.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/buffer.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",
]
}
}