| Index: third_party/protobuf/BUILD.gn
|
| diff --git a/third_party/protobuf/BUILD.gn b/third_party/protobuf/BUILD.gn
|
| index f0bfbc689a7051b9730f8495cf696227efe5dbe4..b6a79786455117387b04135c9c35fc0b3e68854d 100644
|
| --- a/third_party/protobuf/BUILD.gn
|
| +++ b/third_party/protobuf/BUILD.gn
|
| @@ -1,22 +1,25 @@
|
| -# Copyright 2014 The Chromium Authors. All rights reserved.
|
| +# Copyright 2016 The Chromium Authors. All rights reserved.
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| -if (is_win) {
|
| - config_h_dir = "vsprojects"
|
| -} else {
|
| - config_h_dir = "."
|
| -}
|
| -
|
| config("protobuf_config") {
|
| - include_dirs = [
|
| - "src",
|
| - config_h_dir,
|
| - ]
|
| + include_dirs = [ "src" ]
|
| defines = [
|
| "GOOGLE_PROTOBUF_NO_RTTI",
|
| "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
|
| + "HAVE_ZLIB",
|
| ]
|
| + if (!is_win) {
|
| + defines += [ "HAVE_PTHREAD" ]
|
| + }
|
| +}
|
| +
|
| +config("protobuf_warnings") {
|
| + cflags = []
|
| + if (is_clang) {
|
| + # protobuf-3 contains a few functions that are unused.
|
| + cflags += [ "-Wno-unused-function" ]
|
| + }
|
| }
|
|
|
| if (is_component_build) {
|
| @@ -35,13 +38,16 @@ config("using_proto") {
|
| }
|
|
|
| protobuf_lite_sources = [
|
| + "src/google/protobuf/arena.cc",
|
| + "src/google/protobuf/arena.h",
|
| + "src/google/protobuf/arenastring.cc",
|
| + "src/google/protobuf/arenastring.h",
|
| "src/google/protobuf/extension_set.cc",
|
| "src/google/protobuf/extension_set.h",
|
| "src/google/protobuf/generated_message_util.cc",
|
| "src/google/protobuf/generated_message_util.h",
|
| "src/google/protobuf/io/coded_stream.cc",
|
| "src/google/protobuf/io/coded_stream.h",
|
| - "src/google/protobuf/io/coded_stream_inl.h",
|
| "src/google/protobuf/io/zero_copy_stream.cc",
|
| "src/google/protobuf/io/zero_copy_stream.h",
|
| "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
|
| @@ -50,28 +56,33 @@ protobuf_lite_sources = [
|
| "src/google/protobuf/message_lite.h",
|
| "src/google/protobuf/repeated_field.cc",
|
| "src/google/protobuf/repeated_field.h",
|
| - "src/google/protobuf/stubs/atomicops.h",
|
| - "src/google/protobuf/stubs/atomicops_internals_arm_gcc.h",
|
| - "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h",
|
| - "src/google/protobuf/stubs/atomicops_internals_macosx.h",
|
| - "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h",
|
| "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
|
| "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h",
|
| "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
|
| "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h",
|
| + "src/google/protobuf/stubs/bytestream.cc",
|
| + "src/google/protobuf/stubs/bytestream.h",
|
| "src/google/protobuf/stubs/common.cc",
|
| "src/google/protobuf/stubs/common.h",
|
| - "src/google/protobuf/stubs/hash.h",
|
| - "src/google/protobuf/stubs/map-util.h",
|
| + "src/google/protobuf/stubs/int128.cc",
|
| + "src/google/protobuf/stubs/int128.h",
|
| "src/google/protobuf/stubs/once.cc",
|
| "src/google/protobuf/stubs/once.h",
|
| - "src/google/protobuf/stubs/platform_macros.h",
|
| - "src/google/protobuf/unknown_field_set.cc",
|
| - "src/google/protobuf/unknown_field_set.h",
|
| + "src/google/protobuf/stubs/status.cc",
|
| + "src/google/protobuf/stubs/status.h",
|
| + "src/google/protobuf/stubs/statusor.cc",
|
| + "src/google/protobuf/stubs/statusor.h",
|
| + "src/google/protobuf/stubs/stringpiece.cc",
|
| + "src/google/protobuf/stubs/stringpiece.h",
|
| + "src/google/protobuf/stubs/stringprintf.cc",
|
| + "src/google/protobuf/stubs/stringprintf.h",
|
| + "src/google/protobuf/stubs/structurally_valid.cc",
|
| + "src/google/protobuf/stubs/strutil.cc",
|
| + "src/google/protobuf/stubs/strutil.h",
|
| + "src/google/protobuf/stubs/time.cc",
|
| + "src/google/protobuf/stubs/time.h",
|
| "src/google/protobuf/wire_format_lite.cc",
|
| "src/google/protobuf/wire_format_lite.h",
|
| - "src/google/protobuf/wire_format_lite_inl.h",
|
| - "$config_h_dir/config.h",
|
| ]
|
|
|
| protobuf_lite_cflags = []
|
| @@ -82,6 +93,10 @@ if (is_win) {
|
| "/wd4355", # 'this' used in base member initializer list.
|
| "/wd4267", # Size_t to int truncation.
|
| "/wd4291", # No matching operator delete for a placement new.
|
| + "/wd4305", # double to float truncation
|
| + "/wd4065", # switch statement contains 'default' but no 'case' labels
|
| + "/wd4506", # no definition for inline function (protobuf issue #240)
|
| + "/wd4146", # unary minus operator applied to unsigned type
|
| ]
|
| }
|
|
|
| @@ -89,10 +104,18 @@ component("protobuf_lite") {
|
| sources = protobuf_lite_sources
|
|
|
| configs -= [ "//build/config/compiler:chromium_code" ]
|
| - configs += [ "//build/config/compiler:no_chromium_code" ]
|
| + configs += [
|
| + "//build/config/compiler:no_chromium_code",
|
| +
|
| + # Must be after no_chromium_code for warning flags to be ordered
|
| + # correctly.
|
| + ":protobuf_warnings",
|
| + ]
|
| +
|
| if (is_win) {
|
| configs -= [ "//build/config/win:lean_and_mean" ]
|
| }
|
| +
|
| public_configs = [
|
| ":protobuf_config",
|
|
|
| @@ -100,6 +123,10 @@ component("protobuf_lite") {
|
| "//build/config/compiler:no_size_t_to_int_warning",
|
| ]
|
|
|
| + deps = [
|
| + "//build/config/sanitizers:deps",
|
| + ]
|
| +
|
| cflags = protobuf_lite_cflags
|
|
|
| # Required for component builds. See http://crbug.com/172800.
|
| @@ -112,18 +139,21 @@ component("protobuf_lite") {
|
| # This is the full, heavy protobuf lib that's needed for c++ .protos that don't
|
| # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls
|
| # into that category. Do not use in Chrome code.
|
| -
|
| source_set("protobuf_full") {
|
| # Prevent people from depending on this outside our file.
|
| visibility = [ ":*" ]
|
|
|
| sources = protobuf_lite_sources
|
| sources += [
|
| - "src/google/protobuf/compiler/code_generator.h",
|
| - "src/google/protobuf/compiler/command_line_interface.h",
|
| + "src/google/protobuf/any.cc",
|
| + "src/google/protobuf/any.h",
|
| + "src/google/protobuf/any.pb.cc",
|
| + "src/google/protobuf/any.pb.h",
|
| + "src/google/protobuf/api.pb.cc",
|
| + "src/google/protobuf/api.pb.h",
|
| + "src/google/protobuf/compiler/importer.cc",
|
| "src/google/protobuf/compiler/importer.h",
|
| - "src/google/protobuf/compiler/java/java_doc_comment.cc",
|
| - "src/google/protobuf/compiler/java/java_doc_comment.h",
|
| + "src/google/protobuf/compiler/parser.cc",
|
| "src/google/protobuf/compiler/parser.h",
|
| "src/google/protobuf/descriptor.cc",
|
| "src/google/protobuf/descriptor.h",
|
| @@ -131,49 +161,107 @@ source_set("protobuf_full") {
|
| "src/google/protobuf/descriptor.pb.h",
|
| "src/google/protobuf/descriptor_database.cc",
|
| "src/google/protobuf/descriptor_database.h",
|
| + "src/google/protobuf/duration.pb.cc",
|
| + "src/google/protobuf/duration.pb.h",
|
| "src/google/protobuf/dynamic_message.cc",
|
| "src/google/protobuf/dynamic_message.h",
|
| + "src/google/protobuf/empty.pb.cc",
|
| + "src/google/protobuf/empty.pb.h",
|
| "src/google/protobuf/extension_set_heavy.cc",
|
| - "src/google/protobuf/generated_enum_reflection.h",
|
| + "src/google/protobuf/extension_set_heavy.h",
|
| + "src/google/protobuf/field_mask.pb.cc",
|
| + "src/google/protobuf/field_mask.pb.h",
|
| "src/google/protobuf/generated_message_reflection.cc",
|
| "src/google/protobuf/generated_message_reflection.h",
|
| - "src/google/protobuf/io/gzip_stream.h",
|
| +
|
| + # "src/google/protobuf/io/gzip_stream.cc",
|
| + # "src/google/protobuf/io/gzip_stream.h",
|
| + "src/google/protobuf/io/printer.cc",
|
| "src/google/protobuf/io/printer.h",
|
| + "src/google/protobuf/io/strtod.cc",
|
| + "src/google/protobuf/io/strtod.h",
|
| + "src/google/protobuf/io/tokenizer.cc",
|
| "src/google/protobuf/io/tokenizer.h",
|
| + "src/google/protobuf/io/zero_copy_stream_impl.cc",
|
| "src/google/protobuf/io/zero_copy_stream_impl.h",
|
| + "src/google/protobuf/map_field.cc",
|
| + "src/google/protobuf/map_field.h",
|
| "src/google/protobuf/message.cc",
|
| "src/google/protobuf/message.h",
|
| "src/google/protobuf/reflection_ops.cc",
|
| "src/google/protobuf/reflection_ops.h",
|
| "src/google/protobuf/service.cc",
|
| "src/google/protobuf/service.h",
|
| - "src/google/protobuf/stubs/stl_util.h",
|
| - "src/google/protobuf/stubs/stringprintf.cc",
|
| - "src/google/protobuf/stubs/stringprintf.h",
|
| - "src/google/protobuf/stubs/structurally_valid.cc",
|
| - "src/google/protobuf/stubs/strutil.cc",
|
| - "src/google/protobuf/stubs/strutil.h",
|
| + "src/google/protobuf/source_context.pb.cc",
|
| + "src/google/protobuf/source_context.pb.h",
|
| + "src/google/protobuf/struct.pb.cc",
|
| + "src/google/protobuf/struct.pb.h",
|
| + "src/google/protobuf/stubs/mathlimits.cc",
|
| + "src/google/protobuf/stubs/mathlimits.h",
|
| "src/google/protobuf/stubs/substitute.cc",
|
| "src/google/protobuf/stubs/substitute.h",
|
| - "src/google/protobuf/stubs/template_util.h",
|
| - "src/google/protobuf/stubs/type_traits.h",
|
| "src/google/protobuf/text_format.cc",
|
| "src/google/protobuf/text_format.h",
|
| + "src/google/protobuf/timestamp.pb.cc",
|
| + "src/google/protobuf/timestamp.pb.h",
|
| + "src/google/protobuf/type.pb.cc",
|
| + "src/google/protobuf/type.pb.h",
|
| + "src/google/protobuf/unknown_field_set.cc",
|
| + "src/google/protobuf/unknown_field_set.h",
|
| + "src/google/protobuf/util/field_comparator.cc",
|
| + "src/google/protobuf/util/field_comparator.h",
|
| + "src/google/protobuf/util/field_mask_util.cc",
|
| + "src/google/protobuf/util/field_mask_util.h",
|
| + "src/google/protobuf/util/internal/datapiece.cc",
|
| + "src/google/protobuf/util/internal/datapiece.h",
|
| + "src/google/protobuf/util/internal/default_value_objectwriter.cc",
|
| + "src/google/protobuf/util/internal/default_value_objectwriter.h",
|
| + "src/google/protobuf/util/internal/error_listener.cc",
|
| + "src/google/protobuf/util/internal/error_listener.h",
|
| + "src/google/protobuf/util/internal/field_mask_utility.cc",
|
| + "src/google/protobuf/util/internal/field_mask_utility.h",
|
| + "src/google/protobuf/util/internal/json_escaping.cc",
|
| + "src/google/protobuf/util/internal/json_escaping.h",
|
| + "src/google/protobuf/util/internal/json_objectwriter.cc",
|
| + "src/google/protobuf/util/internal/json_objectwriter.h",
|
| + "src/google/protobuf/util/internal/json_stream_parser.cc",
|
| + "src/google/protobuf/util/internal/json_stream_parser.h",
|
| + "src/google/protobuf/util/internal/object_writer.cc",
|
| + "src/google/protobuf/util/internal/object_writer.h",
|
| + "src/google/protobuf/util/internal/proto_writer.cc",
|
| + "src/google/protobuf/util/internal/proto_writer.h",
|
| + "src/google/protobuf/util/internal/protostream_objectsource.cc",
|
| + "src/google/protobuf/util/internal/protostream_objectsource.h",
|
| + "src/google/protobuf/util/internal/protostream_objectwriter.cc",
|
| + "src/google/protobuf/util/internal/protostream_objectwriter.h",
|
| + "src/google/protobuf/util/internal/type_info.cc",
|
| + "src/google/protobuf/util/internal/type_info.h",
|
| + "src/google/protobuf/util/internal/type_info_test_helper.cc",
|
| + "src/google/protobuf/util/internal/type_info_test_helper.h",
|
| + "src/google/protobuf/util/internal/utility.cc",
|
| + "src/google/protobuf/util/internal/utility.h",
|
| + "src/google/protobuf/util/json_util.cc",
|
| + "src/google/protobuf/util/json_util.h",
|
| + "src/google/protobuf/util/message_differencer.cc",
|
| + "src/google/protobuf/util/message_differencer.h",
|
| + "src/google/protobuf/util/time_util.cc",
|
| + "src/google/protobuf/util/time_util.h",
|
| + "src/google/protobuf/util/type_resolver_util.cc",
|
| + "src/google/protobuf/util/type_resolver_util.h",
|
| "src/google/protobuf/wire_format.cc",
|
| "src/google/protobuf/wire_format.h",
|
| -
|
| - # This file pulls in zlib, but it's not actually used by protoc, so
|
| - # instead of compiling zlib for the host, let's just exclude this.
|
| - # "src/src/google/protobuf/io/gzip_stream.cc",
|
| - "src/google/protobuf/compiler/importer.cc",
|
| - "src/google/protobuf/compiler/parser.cc",
|
| - "src/google/protobuf/io/printer.cc",
|
| - "src/google/protobuf/io/tokenizer.cc",
|
| - "src/google/protobuf/io/zero_copy_stream_impl.cc",
|
| + "src/google/protobuf/wrappers.pb.cc",
|
| + "src/google/protobuf/wrappers.pb.h",
|
| ]
|
|
|
| configs -= [ "//build/config/compiler:chromium_code" ]
|
| - configs += [ "//build/config/compiler:no_chromium_code" ]
|
| + configs += [
|
| + "//build/config/compiler:no_chromium_code",
|
| +
|
| + # Must be after no_chromium_code for warning flags to be ordered
|
| + # correctly.
|
| + ":protobuf_warnings",
|
| + ]
|
| if (is_win) {
|
| configs -= [ "//build/config/win:lean_and_mean" ]
|
| }
|
| @@ -192,7 +280,9 @@ if (current_toolchain == host_toolchain) {
|
| executable("protoc") {
|
| sources = [
|
| "src/google/protobuf/compiler/code_generator.cc",
|
| + "src/google/protobuf/compiler/code_generator.h",
|
| "src/google/protobuf/compiler/command_line_interface.cc",
|
| + "src/google/protobuf/compiler/command_line_interface.h",
|
| "src/google/protobuf/compiler/cpp/cpp_enum.cc",
|
| "src/google/protobuf/compiler/cpp/cpp_enum.h",
|
| "src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
|
| @@ -204,8 +294,11 @@ if (current_toolchain == host_toolchain) {
|
| "src/google/protobuf/compiler/cpp/cpp_file.cc",
|
| "src/google/protobuf/compiler/cpp/cpp_file.h",
|
| "src/google/protobuf/compiler/cpp/cpp_generator.cc",
|
| + "src/google/protobuf/compiler/cpp/cpp_generator.h",
|
| "src/google/protobuf/compiler/cpp/cpp_helpers.cc",
|
| "src/google/protobuf/compiler/cpp/cpp_helpers.h",
|
| + "src/google/protobuf/compiler/cpp/cpp_map_field.cc",
|
| + "src/google/protobuf/compiler/cpp/cpp_map_field.h",
|
| "src/google/protobuf/compiler/cpp/cpp_message.cc",
|
| "src/google/protobuf/compiler/cpp/cpp_message.h",
|
| "src/google/protobuf/compiler/cpp/cpp_message_field.cc",
|
| @@ -216,33 +309,13 @@ if (current_toolchain == host_toolchain) {
|
| "src/google/protobuf/compiler/cpp/cpp_service.h",
|
| "src/google/protobuf/compiler/cpp/cpp_string_field.cc",
|
| "src/google/protobuf/compiler/cpp/cpp_string_field.h",
|
| - "src/google/protobuf/compiler/java/java_enum.cc",
|
| - "src/google/protobuf/compiler/java/java_enum.h",
|
| - "src/google/protobuf/compiler/java/java_enum_field.cc",
|
| - "src/google/protobuf/compiler/java/java_enum_field.h",
|
| - "src/google/protobuf/compiler/java/java_extension.cc",
|
| - "src/google/protobuf/compiler/java/java_extension.h",
|
| - "src/google/protobuf/compiler/java/java_field.cc",
|
| - "src/google/protobuf/compiler/java/java_field.h",
|
| - "src/google/protobuf/compiler/java/java_file.cc",
|
| - "src/google/protobuf/compiler/java/java_file.h",
|
| - "src/google/protobuf/compiler/java/java_generator.cc",
|
| - "src/google/protobuf/compiler/java/java_helpers.cc",
|
| - "src/google/protobuf/compiler/java/java_helpers.h",
|
| - "src/google/protobuf/compiler/java/java_message.cc",
|
| - "src/google/protobuf/compiler/java/java_message.h",
|
| - "src/google/protobuf/compiler/java/java_message_field.cc",
|
| - "src/google/protobuf/compiler/java/java_message_field.h",
|
| - "src/google/protobuf/compiler/java/java_primitive_field.cc",
|
| - "src/google/protobuf/compiler/java/java_primitive_field.h",
|
| - "src/google/protobuf/compiler/java/java_service.cc",
|
| - "src/google/protobuf/compiler/java/java_service.h",
|
| - "src/google/protobuf/compiler/java/java_string_field.cc",
|
| - "src/google/protobuf/compiler/java/java_string_field.h",
|
| "src/google/protobuf/compiler/main.cc",
|
| "src/google/protobuf/compiler/plugin.cc",
|
| + "src/google/protobuf/compiler/plugin.h",
|
| "src/google/protobuf/compiler/plugin.pb.cc",
|
| + "src/google/protobuf/compiler/plugin.pb.h",
|
| "src/google/protobuf/compiler/python/python_generator.cc",
|
| + "src/google/protobuf/compiler/python/python_generator.h",
|
| "src/google/protobuf/compiler/subprocess.cc",
|
| "src/google/protobuf/compiler/subprocess.h",
|
| "src/google/protobuf/compiler/zip_writer.cc",
|
| @@ -250,7 +323,13 @@ if (current_toolchain == host_toolchain) {
|
| ]
|
|
|
| configs -= [ "//build/config/compiler:chromium_code" ]
|
| - configs += [ "//build/config/compiler:no_chromium_code" ]
|
| + configs += [
|
| + "//build/config/compiler:no_chromium_code",
|
| +
|
| + # Must be after no_chromium_code for warning flags to be ordered
|
| + # correctly.
|
| + ":protobuf_warnings",
|
| + ]
|
| if (is_win) {
|
| # This is defined internally, don't warn on duplicate.
|
| configs -= [ "//build/config/win:lean_and_mean" ]
|
| @@ -277,17 +356,30 @@ copy("copy_google") {
|
| ]
|
| }
|
|
|
| +copy("copy_six") {
|
| + sources = [
|
| + "third_party/six/six.py",
|
| + ]
|
| + outputs = [
|
| + "$google_python_dir/third_party/six/{{source_file_part}}",
|
| + ]
|
| +}
|
| +
|
| copy("copy_google_protobuf") {
|
| sources = [
|
| "python/google/protobuf/__init__.py",
|
| "python/google/protobuf/descriptor.py",
|
| "python/google/protobuf/descriptor_database.py",
|
| "python/google/protobuf/descriptor_pool.py",
|
| + "python/google/protobuf/json_format.py",
|
| "python/google/protobuf/message.py",
|
| "python/google/protobuf/message_factory.py",
|
| + "python/google/protobuf/proto_builder.py",
|
| "python/google/protobuf/reflection.py",
|
| "python/google/protobuf/service.py",
|
| "python/google/protobuf/service_reflection.py",
|
| + "python/google/protobuf/symbol_database.py",
|
| + "python/google/protobuf/text_encoding.py",
|
| "python/google/protobuf/text_format.py",
|
|
|
| # TODO(ncarter): protoc"s python generator treats
|
| @@ -308,16 +400,16 @@ copy("copy_google_protobuf") {
|
| copy("copy_google_protobuf_internal") {
|
| sources = [
|
| "python/google/protobuf/internal/__init__.py",
|
| + "python/google/protobuf/internal/_parameterized.py",
|
| "python/google/protobuf/internal/api_implementation.py",
|
| "python/google/protobuf/internal/containers.py",
|
| - "python/google/protobuf/internal/cpp_message.py",
|
| "python/google/protobuf/internal/decoder.py",
|
| "python/google/protobuf/internal/encoder.py",
|
| "python/google/protobuf/internal/enum_type_wrapper.py",
|
| - "python/google/protobuf/internal/generator_test.py",
|
| "python/google/protobuf/internal/message_listener.py",
|
| "python/google/protobuf/internal/python_message.py",
|
| "python/google/protobuf/internal/type_checkers.py",
|
| + "python/google/protobuf/internal/well_known_types.py",
|
| "python/google/protobuf/internal/wire_format.py",
|
| ]
|
| outputs = [
|
| @@ -330,10 +422,12 @@ group("py_proto") {
|
| ":copy_google",
|
| ":copy_google_protobuf",
|
| ":copy_google_protobuf_internal",
|
| + ":copy_six",
|
| ]
|
|
|
| # Targets that depend on this should depend on the copied data files.
|
| data = get_target_outputs(":copy_google")
|
| + data += get_target_outputs(":copy_six")
|
| data += get_target_outputs(":copy_google_protobuf")
|
| data += get_target_outputs(":copy_google_protobuf_internal")
|
| }
|
|
|