You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
829 lines
28 KiB
829 lines
28 KiB
# 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" ]
|
|
}
|
|
|
|
include_dirs = [ "." ]
|
|
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",
|
|
]
|
|
}
|
|
|
|
libbase_sublibs = [
|
|
{
|
|
name = "base-core"
|
|
output_name = name + "-${libbase_ver}"
|
|
libs = [
|
|
"pthread",
|
|
"rt",
|
|
"modp_b64",
|
|
]
|
|
pkg_deps = [
|
|
"glib-2.0",
|
|
"libevent",
|
|
]
|
|
configs = [ ":base_core_config" ]
|
|
sources = [
|
|
"base/allocator/allocator_extension.cc",
|
|
"base/allocator/allocator_shim.cc",
|
|
"base/allocator/allocator_shim_default_dispatch_to_glibc.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/command_line.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_annotator.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/memory_mapped_file.cc",
|
|
"base/files/memory_mapped_file_posix.cc",
|
|
"base/files/scoped_file.cc",
|
|
"base/files/scoped_temp_dir.cc",
|
|
"base/guid.cc",
|
|
"base/hash.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/md5.cc",
|
|
"base/memory/aligned_memory.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_handle.cc",
|
|
"base/memory/shared_memory_handle_posix.cc",
|
|
"base/memory/shared_memory_helper.cc",
|
|
"base/memory/shared_memory_mapping.cc",
|
|
"base/memory/shared_memory_posix.cc",
|
|
"base/memory/unsafe_shared_memory_region.cc",
|
|
"base/memory/weak_ptr.cc",
|
|
"base/memory/writable_shared_memory_region.cc",
|
|
"base/message_loop/incoming_task_queue.cc",
|
|
"base/message_loop/message_loop.cc",
|
|
"base/message_loop/message_loop_current.cc",
|
|
"base/message_loop/message_loop_task_runner.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/metrics/bucket_ranges.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/observer_list_threadsafe.cc",
|
|
"base/path_service.cc",
|
|
"base/pending_task.cc",
|
|
"base/pickle.cc",
|
|
"base/posix/file_descriptor_shuffle.cc",
|
|
"base/posix/global_descriptors.cc",
|
|
"base/posix/safe_strerror.cc",
|
|
"base/posix/unix_domain_socket.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_info_linux.cc",
|
|
"base/process/process_iterator.cc",
|
|
"base/process/process_iterator_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/sha1.cc",
|
|
"base/strings/nullable_string16.cc",
|
|
"base/strings/pattern.cc",
|
|
"base/strings/safe_sprintf.cc",
|
|
"base/strings/strcat.cc",
|
|
"base/strings/string16.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_string_conversion_utils.cc",
|
|
"base/strings/utf_string_conversions.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/sys_info.cc",
|
|
"base/sys_info_chromeos.cc",
|
|
"base/sys_info_linux.cc",
|
|
"base/sys_info_posix.cc",
|
|
"base/task/cancelable_task_tracker.cc",
|
|
"base/task_runner.cc",
|
|
"base/task_scheduler/delayed_task_manager.cc",
|
|
"base/task_scheduler/environment_config.cc",
|
|
"base/task_scheduler/lazy_task_runner.cc",
|
|
"base/task_scheduler/post_task.cc",
|
|
"base/task_scheduler/priority_queue.cc",
|
|
"base/task_scheduler/scheduler_lock_impl.cc",
|
|
"base/task_scheduler/scheduler_single_thread_task_runner_manager.cc",
|
|
"base/task_scheduler/scheduler_worker.cc",
|
|
"base/task_scheduler/scheduler_worker_pool.cc",
|
|
"base/task_scheduler/scheduler_worker_pool_impl.cc",
|
|
"base/task_scheduler/scheduler_worker_pool_params.cc",
|
|
"base/task_scheduler/scheduler_worker_stack.cc",
|
|
"base/task_scheduler/scoped_set_task_priority_for_current_thread.cc",
|
|
"base/task_scheduler/sequence.cc",
|
|
"base/task_scheduler/sequence_sort_key.cc",
|
|
"base/task_scheduler/service_thread.cc",
|
|
"base/task_scheduler/task.cc",
|
|
"base/task_scheduler/task_scheduler.cc",
|
|
"base/task_scheduler/task_scheduler_impl.cc",
|
|
"base/task_scheduler/task_tracker.cc",
|
|
"base/task_scheduler/task_tracker_posix.cc",
|
|
"base/task_scheduler/task_traits.cc",
|
|
"base/third_party/dynamic_annotations/dynamic_annotations.c",
|
|
"base/third_party/icu/icu_utf.cc",
|
|
"base/third_party/nspr/prtime.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/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_exploded_posix.cc",
|
|
"base/time/time_now_posix.cc",
|
|
"base/time/time_override.cc",
|
|
"base/timer/elapsed_timer.cc",
|
|
"base/timer/timer.cc",
|
|
"base/unguessable_token.cc",
|
|
"base/value_iterators.cc",
|
|
"base/values.cc",
|
|
"base/version.cc",
|
|
"base/vlog.cc",
|
|
]
|
|
},
|
|
|
|
{
|
|
name = "base-dl"
|
|
output_name = name + "-${libbase_ver}"
|
|
deps = [ ":base-core" ]
|
|
libs = [ "dl" ]
|
|
sources = [
|
|
"base/native_library.cc",
|
|
"base/native_library_posix.cc",
|
|
"base/scoped_native_library.cc",
|
|
]
|
|
},
|
|
|
|
{
|
|
name = "base-policy"
|
|
output_name = name + "-${libbase_ver}"
|
|
deps = [ ":base-core" ]
|
|
libs = [ "re2" ]
|
|
sources = [
|
|
"components/json_schema/json_schema_constants.cc",
|
|
"components/json_schema/json_schema_validator.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"
|
|
output_name = name + "-${libbase_ver}"
|
|
testonly = true
|
|
sources = [
|
|
"base/test/scoped_task_environment.cc",
|
|
"base/test/simple_test_clock.cc",
|
|
"base/test/simple_test_tick_clock.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"
|
|
output_name = name + "-${libbase_ver}"
|
|
deps = [
|
|
":base-core",
|
|
":base-dl",
|
|
]
|
|
pkg_deps = [
|
|
"nss",
|
|
"openssl",
|
|
]
|
|
sources = [
|
|
"crypto/hmac.cc",
|
|
"crypto/hmac_nss.cc",
|
|
"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",
|
|
|
|
# Added to libchrome only (not upstream) to support OpenSSL 1.1 API
|
|
"crypto/libcrypto-compat.c",
|
|
]
|
|
},
|
|
]
|
|
}
|
|
|
|
if (use.dbus) {
|
|
libbase_sublibs += [
|
|
{
|
|
name = "base-dbus"
|
|
output_name = name + "-${libbase_ver}"
|
|
deps = [ ":base-core" ]
|
|
pkg_deps = [ "dbus-1" ]
|
|
if (use.fuzzer) {
|
|
pkg_deps += [ "protobuf" ]
|
|
} else {
|
|
pkg_deps += [ "protobuf-lite" ]
|
|
}
|
|
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"
|
|
output_name = name + "-${libbase_ver}"
|
|
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",
|
|
]
|
|
},
|
|
]
|
|
}
|
|
|
|
if (use.timers) {
|
|
libbase_sublibs += [
|
|
{
|
|
name = "base-timers"
|
|
output_name = name + "-${libbase_ver}"
|
|
deps = [ ":base-core" ]
|
|
sources = [ "components/timers/alarm_timer_chromeos.cc" ]
|
|
},
|
|
|
|
{
|
|
name = "base-timer_test_support"
|
|
output_name = name + "-${libbase_ver}"
|
|
testonly = true
|
|
sources = [ "base/timer/mock_timer.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) {
|
|
output_name = attr.output_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",
|
|
"//common-mk:visibility_default",
|
|
]
|
|
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}-${libbase_ver}.so" ]
|
|
args = [ "--output" ] + outputs + [ "--" ] + [
|
|
"GROUP",
|
|
"(",
|
|
"AS_NEEDED",
|
|
"(",
|
|
]
|
|
foreach(attr, libbase_sublibs) {
|
|
if (!defined(attr.testonly) || !attr.testonly) {
|
|
args += [ "-l" + attr.output_name ]
|
|
}
|
|
}
|
|
args += [
|
|
")",
|
|
")",
|
|
]
|
|
}
|
|
|
|
libchrome_exported_cflags = [
|
|
"-I/usr/include/base-${libbase_ver}",
|
|
"-Wno-unused-local-typedefs",
|
|
"-DBASE_VER=${libbase_ver}",
|
|
]
|
|
|
|
if (use.asan) {
|
|
libchrome_exported_cflags += [ "-DLEAK_SANITIZER" ]
|
|
}
|
|
|
|
generate_pkg_config("libchrome") {
|
|
deps = [ ":base" ]
|
|
output_name = "libchrome-${libbase_ver}"
|
|
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
|
|
}
|
|
}
|
|
libs = [ "-lbase-${libbase_ver}" ]
|
|
libs_private = []
|
|
foreach(attr, libbase_sublibs) {
|
|
if (!defined(attr.testonly) || !attr.testonly) {
|
|
libs_private += [ "-l" + attr.output_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}-${libbase_ver}.a" ]
|
|
args = [ "--output" ] + outputs + [ "--" ] + [
|
|
"GROUP",
|
|
"(",
|
|
"AS_NEEDED",
|
|
"(",
|
|
]
|
|
foreach(attr, libbase_sublibs) {
|
|
if (defined(attr.testonly) && attr.testonly) {
|
|
args += [ "-l" + attr.output_name ]
|
|
}
|
|
}
|
|
args += [
|
|
")",
|
|
")",
|
|
]
|
|
}
|
|
|
|
generate_pkg_config("libchrome-test") {
|
|
deps = [ ":base-test" ]
|
|
output_name = "libchrome-test-${libbase_ver}"
|
|
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-${libbase_ver}" ]
|
|
libs_private = []
|
|
foreach(attr, libbase_sublibs) {
|
|
if (defined(attr.testonly) && attr.testonly) {
|
|
libs_private += [ "-l" + attr.output_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"
|
|
typemaps = get_target_outputs(":mojom_type_mappings")
|
|
sources = [
|
|
"ipc/ipc.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/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/mojo/geometry.mojom",
|
|
"ui/gfx/range/mojo/range.mojom",
|
|
]
|
|
}
|
|
|
|
generate_mojom_bindings_gen("mojom_bindings_native_gen") {
|
|
mojom_bindings_generator =
|
|
"mojo/public/tools/bindings/mojom_bindings_generator.py"
|
|
sources = [
|
|
"mojo/public/interfaces/bindings/interface_control_messages.mojom",
|
|
"mojo/public/interfaces/bindings/native_struct.mojom",
|
|
"mojo/public/interfaces/bindings/pipe_control_messages.mojom",
|
|
]
|
|
disallow_native_types = true
|
|
disallow_interfaces = true
|
|
}
|
|
|
|
# Probably we should consider build libmojo as a part of libchrome.
|
|
# crbug.com/924035.
|
|
static_library("mojo") {
|
|
output_name = "mojo-${libbase_ver}"
|
|
deps = [
|
|
":base-core",
|
|
":base-crypto",
|
|
":mojom_bindings_gen",
|
|
":mojom_bindings_native_gen",
|
|
":mojom_type_mappings",
|
|
]
|
|
|
|
# TODO(hidehiko): Consolidate with build_config.h.
|
|
configs -= [
|
|
"//common-mk:use_thin_archive",
|
|
"//common-mk:pie",
|
|
]
|
|
configs += [
|
|
":libchrome_config",
|
|
"//common-mk:visibility_default",
|
|
"//common-mk:nouse_thin_archive",
|
|
"//common-mk:pic",
|
|
]
|
|
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",
|
|
"mojo/core/invitation_dispatcher.cc",
|
|
"mojo/core/connection_params.cc",
|
|
"mojo/core/channel_posix.cc",
|
|
"mojo/core/platform_handle_dispatcher.cc",
|
|
"mojo/core/mojo_core.cc",
|
|
"mojo/core/channel.cc",
|
|
"mojo/core/entrypoints.cc",
|
|
"mojo/core/broker_posix.cc",
|
|
"mojo/core/data_pipe_producer_dispatcher.cc",
|
|
"mojo/core/broker_host.cc",
|
|
"mojo/core/watcher_dispatcher.cc",
|
|
"mojo/core/request_context.cc",
|
|
"mojo/core/configuration.cc",
|
|
"mojo/core/node_channel.cc",
|
|
"mojo/core/shared_buffer_dispatcher.cc",
|
|
"mojo/core/watch.cc",
|
|
"mojo/core/embedder/scoped_ipc_support.cc",
|
|
"mojo/core/embedder/embedder.cc",
|
|
"mojo/core/message_pipe_dispatcher.cc",
|
|
"mojo/core/handle_table.cc",
|
|
"mojo/core/core.cc",
|
|
"mojo/core/ports/event.cc",
|
|
"mojo/core/ports/name.cc",
|
|
"mojo/core/ports/port.cc",
|
|
"mojo/core/ports/message_queue.cc",
|
|
"mojo/core/ports/port_locker.cc",
|
|
"mojo/core/ports/node.cc",
|
|
"mojo/core/ports/user_message.cc",
|
|
"mojo/core/ports/port_ref.cc",
|
|
"mojo/core/data_pipe_consumer_dispatcher.cc",
|
|
"mojo/core/scoped_process_handle.cc",
|
|
"mojo/core/node_controller.cc",
|
|
"mojo/core/watcher_set.cc",
|
|
"mojo/core/dispatcher.cc",
|
|
"mojo/core/platform_handle_in_transit.cc",
|
|
"mojo/core/platform_handle_utils.cc",
|
|
"mojo/core/platform_shared_memory_mapping.cc",
|
|
"mojo/core/user_message_impl.cc",
|
|
"mojo/core/data_pipe_control_message.cc",
|
|
"mojo/public/c/system/thunks.cc",
|
|
"mojo/public/cpp/base/big_string_mojom_traits.cc",
|
|
"mojo/public/cpp/base/shared_memory_mojom_traits.cc",
|
|
"mojo/public/cpp/base/unguessable_token_mojom_traits.cc",
|
|
"mojo/public/cpp/base/ref_counted_memory_mojom_traits.cc",
|
|
"mojo/public/cpp/base/big_buffer.cc",
|
|
"mojo/public/cpp/base/read_only_buffer_mojom_traits.cc",
|
|
"mojo/public/cpp/base/string16_mojom_traits.cc",
|
|
"mojo/public/cpp/base/big_buffer_mojom_traits.cc",
|
|
"mojo/public/cpp/base/file_info_mojom_traits.cc",
|
|
"mojo/public/cpp/base/time_mojom_traits.cc",
|
|
"mojo/public/cpp/base/thread_priority_mojom_traits.cc",
|
|
"mojo/public/cpp/base/text_direction_mojom_traits.cc",
|
|
"mojo/public/cpp/base/values_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/file_mojom_traits.cc",
|
|
"mojo/public/cpp/bindings/lib/serialization_context.cc",
|
|
"mojo/public/cpp/bindings/lib/associated_interface_ptr_state.cc",
|
|
"mojo/public/cpp/bindings/lib/array_internal.cc",
|
|
"mojo/public/cpp/bindings/lib/interface_ptr_state.cc",
|
|
"mojo/public/cpp/bindings/lib/buffer.cc",
|
|
"mojo/public/cpp/bindings/lib/sync_call_restrictions.cc",
|
|
"mojo/public/cpp/bindings/lib/multiplex_router.cc",
|
|
"mojo/public/cpp/bindings/lib/sync_handle_watcher.cc",
|
|
"mojo/public/cpp/bindings/lib/validation_errors.cc",
|
|
"mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.cc",
|
|
"mojo/public/cpp/bindings/lib/message_dumper.cc",
|
|
"mojo/public/cpp/bindings/lib/sync_event_watcher.cc",
|
|
"mojo/public/cpp/bindings/lib/task_runner_helper.cc",
|
|
"mojo/public/cpp/bindings/lib/sequence_local_sync_event_watcher.cc",
|
|
"mojo/public/cpp/bindings/lib/validation_context.cc",
|
|
"mojo/public/cpp/bindings/lib/associated_group.cc",
|
|
"mojo/public/cpp/bindings/lib/native_struct_serialization.cc",
|
|
"mojo/public/cpp/bindings/lib/validation_util.cc",
|
|
"mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc",
|
|
"mojo/public/cpp/bindings/lib/filter_chain.cc",
|
|
"mojo/public/cpp/bindings/lib/message.cc",
|
|
"mojo/public/cpp/bindings/lib/unserialized_message_context.cc",
|
|
"mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc",
|
|
"mojo/public/cpp/bindings/lib/control_message_proxy.cc",
|
|
"mojo/public/cpp/bindings/lib/control_message_handler.cc",
|
|
"mojo/public/cpp/bindings/lib/connector.cc",
|
|
"mojo/public/cpp/bindings/lib/interface_endpoint_client.cc",
|
|
"mojo/public/cpp/bindings/lib/sync_handle_registry.cc",
|
|
"mojo/public/cpp/bindings/lib/associated_binding.cc",
|
|
"mojo/public/cpp/bindings/lib/message_header_validator.cc",
|
|
"mojo/public/cpp/bindings/lib/associated_group_controller.cc",
|
|
"mojo/public/cpp/bindings/lib/associated_interface_ptr.cc",
|
|
"mojo/public/cpp/bindings/lib/fixed_buffer.cc",
|
|
"mojo/public/cpp/bindings/lib/message_internal.cc",
|
|
"mojo/public/cpp/bindings/lib/binding_state.cc",
|
|
"mojo/public/cpp/platform/platform_channel_endpoint.cc",
|
|
"mojo/public/cpp/platform/platform_handle.cc",
|
|
"mojo/public/cpp/platform/named_platform_channel.cc",
|
|
"mojo/public/cpp/platform/platform_channel.cc",
|
|
"mojo/public/cpp/platform/platform_channel_server_endpoint.cc",
|
|
"mojo/public/cpp/platform/socket_utils_posix.cc",
|
|
"mojo/public/cpp/platform/named_platform_channel_posix.cc",
|
|
"mojo/public/cpp/system/buffer.cc",
|
|
"mojo/public/cpp/system/platform_handle.cc",
|
|
"mojo/public/cpp/system/wait.cc",
|
|
"mojo/public/cpp/system/wait_set.cc",
|
|
"mojo/public/cpp/system/data_pipe_utils.cc",
|
|
"mojo/public/cpp/system/scope_to_message_pipe.cc",
|
|
"mojo/public/cpp/system/handle_signal_tracker.cc",
|
|
"mojo/public/cpp/system/trap.cc",
|
|
"mojo/public/cpp/system/isolated_connection.cc",
|
|
"mojo/public/cpp/system/string_data_pipe_producer.cc",
|
|
"mojo/public/cpp/system/data_pipe_drainer.cc",
|
|
"mojo/public/cpp/system/invitation.cc",
|
|
"mojo/public/cpp/system/simple_watcher.cc",
|
|
"mojo/public/cpp/system/file_data_pipe_producer.cc",
|
|
"mojo/public/cpp/system/message_pipe.cc",
|
|
] + get_target_outputs(":mojom_bindings_gen") +
|
|
get_target_outputs(":mojom_bindings_native_gen")
|
|
}
|
|
|
|
generate_pkg_config("libmojo") {
|
|
deps = [ ":mojo" ]
|
|
output_name = "libmojo-${libbase_ver}"
|
|
description = "Chrome Mojo IPC library"
|
|
version = "${libbase_ver}"
|
|
libs = [ "-lmojo-${libbase_ver}" ]
|
|
cflags = [
|
|
"-I/usr/lib/base-${libbase_ver}",
|
|
"-Wno-cast-qual",
|
|
"-Wno-cast-align",
|
|
]
|
|
}
|
|
}
|