| OLD | NEW |
| (Empty) |
| 1 diff --git a/third_party/protobuf/BUILD.gn b/third_party/protobuf/BUILD.gn | |
| 2 new file mode 100644 | |
| 3 index 0000000..1c2c85e | |
| 4 --- /dev/null | |
| 5 +++ b/third_party/protobuf/BUILD.gn | |
| 6 @@ -0,0 +1,569 @@ | |
| 7 +# Copyright 2014 The Chromium Authors. All rights reserved. | |
| 8 +# Use of this source code is governed by a BSD-style license that can be | |
| 9 +# found in the LICENSE file. | |
| 10 + | |
| 11 +config("protobuf_config") { | |
| 12 + include_dirs = [ "src" ] | |
| 13 + defines = [ | |
| 14 + "GOOGLE_PROTOBUF_NO_RTTI", | |
| 15 + "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", | |
| 16 + "HAVE_PTHREAD", | |
| 17 + ] | |
| 18 + | |
| 19 + if (is_mac || (current_toolchain == host_toolchain && host_os == "mac")) { | |
| 20 + # Chromium builds don't yet support __thread on Mac -- not sure if the | |
| 21 + # limiting factor is using libc++ or having OS X >=10.7. Remove this once | |
| 22 + # the above aren't issues. | |
| 23 + defines += [ "GOOGLE_PROTOBUF_NO_THREADLOCAL" ] | |
| 24 + } | |
| 25 +} | |
| 26 + | |
| 27 +# This config should be applied to targets using generated code from the proto | |
| 28 +# compiler. It sets up the include directories properly. | |
| 29 +config("using_proto") { | |
| 30 + include_dirs = [ | |
| 31 + "src", | |
| 32 + "$root_gen_dir/protoc_out", | |
| 33 + ] | |
| 34 +} | |
| 35 + | |
| 36 +protobuf_lite_sources = [ | |
| 37 + "src/google/protobuf/arena.cc", | |
| 38 + "src/google/protobuf/arena.h", | |
| 39 + "src/google/protobuf/arenastring.cc", | |
| 40 + "src/google/protobuf/arenastring.h", | |
| 41 + "src/google/protobuf/descriptor.h", | |
| 42 + "src/google/protobuf/descriptor.pb.h", | |
| 43 + "src/google/protobuf/extension_set.cc", | |
| 44 + "src/google/protobuf/extension_set.h", | |
| 45 + "src/google/protobuf/generated_enum_reflection.h", | |
| 46 + "src/google/protobuf/generated_enum_util.h", | |
| 47 + "src/google/protobuf/generated_message_util.cc", | |
| 48 + "src/google/protobuf/generated_message_util.h", | |
| 49 + "src/google/protobuf/io/coded_stream.cc", | |
| 50 + "src/google/protobuf/io/coded_stream.h", | |
| 51 + "src/google/protobuf/io/coded_stream_inl.h", | |
| 52 + "src/google/protobuf/io/zero_copy_stream.cc", | |
| 53 + "src/google/protobuf/io/zero_copy_stream.h", | |
| 54 + "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", | |
| 55 + "src/google/protobuf/io/zero_copy_stream_impl_lite.h", | |
| 56 + "src/google/protobuf/message.h", | |
| 57 + "src/google/protobuf/message_lite.cc", | |
| 58 + "src/google/protobuf/message_lite.h", | |
| 59 + "src/google/protobuf/metadata.h", | |
| 60 + "src/google/protobuf/repeated_field.cc", | |
| 61 + "src/google/protobuf/repeated_field.h", | |
| 62 + "src/google/protobuf/stubs/atomic_sequence_num.h", | |
| 63 + "src/google/protobuf/stubs/atomicops.h", | |
| 64 + "src/google/protobuf/stubs/atomicops_internals_aix.h", | |
| 65 + "src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h", | |
| 66 + "src/google/protobuf/stubs/atomicops_internals_arm_gcc.h", | |
| 67 + "src/google/protobuf/stubs/atomicops_internals_arm_qnx.h", | |
| 68 + "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h", | |
| 69 + "src/google/protobuf/stubs/atomicops_internals_generic_gcc.h", | |
| 70 + "src/google/protobuf/stubs/atomicops_internals_macosx.h", | |
| 71 + "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h", | |
| 72 + "src/google/protobuf/stubs/atomicops_internals_pnacl.h", | |
| 73 + "src/google/protobuf/stubs/atomicops_internals_solaris.h", | |
| 74 + "src/google/protobuf/stubs/atomicops_internals_tsan.h", | |
| 75 + "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", | |
| 76 + "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h", | |
| 77 + "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", | |
| 78 + "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h", | |
| 79 + "src/google/protobuf/stubs/bytestream.cc", | |
| 80 + "src/google/protobuf/stubs/bytestream.h", | |
| 81 + "src/google/protobuf/stubs/callback.h", | |
| 82 + "src/google/protobuf/stubs/casts.h", | |
| 83 + "src/google/protobuf/stubs/common.cc", | |
| 84 + "src/google/protobuf/stubs/common.h", | |
| 85 + "src/google/protobuf/stubs/fastmem.h", | |
| 86 + "src/google/protobuf/stubs/hash.h", | |
| 87 + "src/google/protobuf/stubs/logging.h", | |
| 88 + "src/google/protobuf/stubs/macros.h", | |
| 89 + "src/google/protobuf/stubs/map_util.h", | |
| 90 + "src/google/protobuf/stubs/mathlimits.h", | |
| 91 + "src/google/protobuf/stubs/mutex.h", | |
| 92 + "src/google/protobuf/stubs/once.cc", | |
| 93 + "src/google/protobuf/stubs/once.h", | |
| 94 + "src/google/protobuf/stubs/platform_macros.h", | |
| 95 + "src/google/protobuf/stubs/port.h", | |
| 96 + "src/google/protobuf/stubs/scoped_ptr.h", | |
| 97 + "src/google/protobuf/stubs/status.cc", | |
| 98 + "src/google/protobuf/stubs/status.h", | |
| 99 + "src/google/protobuf/stubs/statusor.cc", | |
| 100 + "src/google/protobuf/stubs/statusor.h", | |
| 101 + "src/google/protobuf/stubs/stl_util.h", | |
| 102 + "src/google/protobuf/stubs/stringpiece.cc", | |
| 103 + "src/google/protobuf/stubs/stringpiece.h", | |
| 104 + "src/google/protobuf/stubs/stringprintf.cc", | |
| 105 + "src/google/protobuf/stubs/stringprintf.h", | |
| 106 + "src/google/protobuf/stubs/strutil.cc", | |
| 107 + "src/google/protobuf/stubs/strutil.h", | |
| 108 + "src/google/protobuf/stubs/template_util.h", | |
| 109 + "src/google/protobuf/stubs/time.cc", | |
| 110 + "src/google/protobuf/stubs/time.h", | |
| 111 + "src/google/protobuf/stubs/type_traits.h", | |
| 112 + "src/google/protobuf/testing/googletest.h", | |
| 113 + "src/google/protobuf/unknown_field_set.h", | |
| 114 + "src/google/protobuf/wire_format_lite.cc", | |
| 115 + "src/google/protobuf/wire_format_lite.h", | |
| 116 + "src/google/protobuf/wire_format_lite_inl.h", | |
| 117 +] | |
| 118 + | |
| 119 +protobuf_lite_cflags = [] | |
| 120 +if (is_win) { | |
| 121 + protobuf_lite_cflags = [ | |
| 122 + "/wd4018", # Signed/unsigned mismatch in comparison. | |
| 123 + "/wd4065", # Switch statement contains 'default' but no 'case' labels | |
| 124 + "/wd4146", # Unary minus operator applied to unsigned type | |
| 125 + "/wd4244", # Implicit conversion, possible loss of data. | |
| 126 + "/wd4267", # Size_t to int truncation. | |
| 127 + "/wd4291", # No matching operator delete for a placement new. | |
| 128 + "/wd4355", # 'this' used in base member initializer list. | |
| 129 + "/wd4506", # No definition for inline function. | |
| 130 + ] | |
| 131 +} | |
| 132 + | |
| 133 +source_set("protobuf_lite") { | |
| 134 + sources = protobuf_lite_sources | |
| 135 + | |
| 136 + configs -= [ "//build/config/compiler:chromium_code" ] | |
| 137 + configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 138 + if (is_win) { | |
| 139 + configs -= [ "//build/config/win:lean_and_mean" ] | |
| 140 + } | |
| 141 + public_configs = [ | |
| 142 + ":protobuf_config", | |
| 143 + | |
| 144 + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | |
| 145 + "//build/config/compiler:no_size_t_to_int_warning", | |
| 146 + ] | |
| 147 + | |
| 148 + cflags = protobuf_lite_cflags | |
| 149 +} | |
| 150 + | |
| 151 +# This is the full, heavy protobuf lib that's needed for c++ .protos that don't | |
| 152 +# specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls | |
| 153 +# into that category. Do not use in Chrome code. | |
| 154 + | |
| 155 +source_set("protobuf_full") { | |
| 156 + # Prevent people from depending on this outside our file. | |
| 157 + visibility = [ ":*" ] | |
| 158 + | |
| 159 + sources = [ | |
| 160 + "src/google/protobuf/any.cc", | |
| 161 + "src/google/protobuf/any.h", | |
| 162 + "src/google/protobuf/any.pb.cc", | |
| 163 + "src/google/protobuf/any.pb.h", | |
| 164 + "src/google/protobuf/api.pb.cc", | |
| 165 + "src/google/protobuf/api.pb.h", | |
| 166 + "src/google/protobuf/compiler/importer.cc", | |
| 167 + "src/google/protobuf/compiler/importer.h", | |
| 168 + "src/google/protobuf/compiler/parser.cc", | |
| 169 + "src/google/protobuf/compiler/parser.h", | |
| 170 + "src/google/protobuf/descriptor.cc", | |
| 171 + "src/google/protobuf/descriptor.pb.cc", | |
| 172 + "src/google/protobuf/descriptor_database.cc", | |
| 173 + "src/google/protobuf/descriptor_database.h", | |
| 174 + "src/google/protobuf/duration.pb.cc", | |
| 175 + "src/google/protobuf/duration.pb.h", | |
| 176 + "src/google/protobuf/dynamic_message.cc", | |
| 177 + "src/google/protobuf/dynamic_message.h", | |
| 178 + "src/google/protobuf/empty.pb.cc", | |
| 179 + "src/google/protobuf/empty.pb.h", | |
| 180 + "src/google/protobuf/extension_set_heavy.cc", | |
| 181 + "src/google/protobuf/field_mask.pb.cc", | |
| 182 + "src/google/protobuf/field_mask.pb.h", | |
| 183 + "src/google/protobuf/generated_message_reflection.cc", | |
| 184 + "src/google/protobuf/generated_message_reflection.h", | |
| 185 + | |
| 186 + # gzip_stream.cc pulls in zlib, but it's not actually used by protoc, just | |
| 187 + # by test code; so instead of compiling zlib for the host, let's just | |
| 188 + # exclude these. | |
| 189 + # "src/google/protobuf/io/gzip_stream.cc", | |
| 190 + # "src/google/protobuf/io/gzip_stream.h", | |
| 191 + "src/google/protobuf/io/printer.cc", | |
| 192 + "src/google/protobuf/io/printer.h", | |
| 193 + "src/google/protobuf/io/strtod.cc", | |
| 194 + "src/google/protobuf/io/strtod.h", | |
| 195 + "src/google/protobuf/io/tokenizer.cc", | |
| 196 + "src/google/protobuf/io/tokenizer.h", | |
| 197 + "src/google/protobuf/io/zero_copy_stream_impl.cc", | |
| 198 + "src/google/protobuf/io/zero_copy_stream_impl.h", | |
| 199 + "src/google/protobuf/map.h", | |
| 200 + "src/google/protobuf/map_entry_lite.h", | |
| 201 + "src/google/protobuf/map_field.cc", | |
| 202 + "src/google/protobuf/map_field.h", | |
| 203 + "src/google/protobuf/map_field_inl.h", | |
| 204 + "src/google/protobuf/map_field_lite.h", | |
| 205 + "src/google/protobuf/map_type_handler.h", | |
| 206 + "src/google/protobuf/message.cc", | |
| 207 + "src/google/protobuf/reflection_ops.cc", | |
| 208 + "src/google/protobuf/reflection_ops.h", | |
| 209 + "src/google/protobuf/service.cc", | |
| 210 + "src/google/protobuf/service.h", | |
| 211 + "src/google/protobuf/source_context.pb.cc", | |
| 212 + "src/google/protobuf/source_context.pb.h", | |
| 213 + "src/google/protobuf/struct.pb.cc", | |
| 214 + "src/google/protobuf/struct.pb.h", | |
| 215 + "src/google/protobuf/stubs/mathlimits.cc", | |
| 216 + "src/google/protobuf/stubs/mathutil.h", | |
| 217 + "src/google/protobuf/stubs/shared_ptr.h", | |
| 218 + "src/google/protobuf/stubs/singleton.h", | |
| 219 + "src/google/protobuf/stubs/status_macros.h", | |
| 220 + "src/google/protobuf/stubs/structurally_valid.cc", | |
| 221 + "src/google/protobuf/stubs/substitute.cc", | |
| 222 + "src/google/protobuf/stubs/substitute.h", | |
| 223 + "src/google/protobuf/text_format.cc", | |
| 224 + "src/google/protobuf/text_format.h", | |
| 225 + "src/google/protobuf/timestamp.pb.cc", | |
| 226 + "src/google/protobuf/timestamp.pb.h", | |
| 227 + "src/google/protobuf/type.pb.cc", | |
| 228 + "src/google/protobuf/type.pb.h", | |
| 229 + "src/google/protobuf/unknown_field_set.cc", | |
| 230 + "src/google/protobuf/util/field_comparator.cc", | |
| 231 + "src/google/protobuf/util/field_comparator.h", | |
| 232 + "src/google/protobuf/util/internal/constants.h", | |
| 233 + "src/google/protobuf/util/internal/datapiece.cc", | |
| 234 + "src/google/protobuf/util/internal/datapiece.h", | |
| 235 + "src/google/protobuf/util/internal/default_value_objectwriter.cc", | |
| 236 + "src/google/protobuf/util/internal/default_value_objectwriter.h", | |
| 237 + "src/google/protobuf/util/internal/error_listener.cc", | |
| 238 + "src/google/protobuf/util/internal/error_listener.h", | |
| 239 + "src/google/protobuf/util/internal/field_mask_utility.cc", | |
| 240 + "src/google/protobuf/util/internal/field_mask_utility.h", | |
| 241 + "src/google/protobuf/util/internal/json_escaping.cc", | |
| 242 + "src/google/protobuf/util/internal/json_escaping.h", | |
| 243 + "src/google/protobuf/util/internal/json_objectwriter.cc", | |
| 244 + "src/google/protobuf/util/internal/json_objectwriter.h", | |
| 245 + "src/google/protobuf/util/internal/json_stream_parser.cc", | |
| 246 + "src/google/protobuf/util/internal/json_stream_parser.h", | |
| 247 + "src/google/protobuf/util/internal/location_tracker.h", | |
| 248 + "src/google/protobuf/util/internal/object_location_tracker.h", | |
| 249 + "src/google/protobuf/util/internal/object_source.h", | |
| 250 + "src/google/protobuf/util/internal/object_writer.cc", | |
| 251 + "src/google/protobuf/util/internal/object_writer.h", | |
| 252 + "src/google/protobuf/util/internal/protostream_objectsource.cc", | |
| 253 + "src/google/protobuf/util/internal/protostream_objectsource.h", | |
| 254 + "src/google/protobuf/util/internal/protostream_objectwriter.cc", | |
| 255 + "src/google/protobuf/util/internal/protostream_objectwriter.h", | |
| 256 + "src/google/protobuf/util/internal/snake2camel_objectwriter.h", | |
| 257 + "src/google/protobuf/util/internal/structured_objectwriter.h", | |
| 258 + "src/google/protobuf/util/internal/type_info.cc", | |
| 259 + "src/google/protobuf/util/internal/type_info.h", | |
| 260 + "src/google/protobuf/util/internal/type_info_test_helper.cc", | |
| 261 + "src/google/protobuf/util/internal/type_info_test_helper.h", | |
| 262 + "src/google/protobuf/util/internal/utility.cc", | |
| 263 + "src/google/protobuf/util/internal/utility.h", | |
| 264 + "src/google/protobuf/util/json_util.cc", | |
| 265 + "src/google/protobuf/util/json_util.h", | |
| 266 + "src/google/protobuf/util/message_differencer.cc", | |
| 267 + "src/google/protobuf/util/message_differencer.h", | |
| 268 + "src/google/protobuf/util/type_resolver.h", | |
| 269 + "src/google/protobuf/util/type_resolver_util.cc", | |
| 270 + "src/google/protobuf/util/type_resolver_util.h", | |
| 271 + "src/google/protobuf/wire_format.cc", | |
| 272 + "src/google/protobuf/wire_format.h", | |
| 273 + "src/google/protobuf/wrappers.pb.cc", | |
| 274 + "src/google/protobuf/wrappers.pb.h", | |
| 275 + ] | |
| 276 + | |
| 277 + configs -= [ "//build/config/compiler:chromium_code" ] | |
| 278 + configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 279 + if (is_win) { | |
| 280 + configs -= [ "//build/config/win:lean_and_mean" ] | |
| 281 + } | |
| 282 + public_configs = [ | |
| 283 + ":protobuf_config", | |
| 284 + | |
| 285 + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | |
| 286 + "//build/config/compiler:no_size_t_to_int_warning", | |
| 287 + ] | |
| 288 + | |
| 289 + cflags = protobuf_lite_cflags | |
| 290 + | |
| 291 + deps = [ | |
| 292 + ":protobuf_lite", | |
| 293 + ] | |
| 294 +} | |
| 295 + | |
| 296 +# Only compile the compiler for the host architecture. | |
| 297 +if (current_toolchain == host_toolchain) { | |
| 298 + executable("protoc") { | |
| 299 + sources = [ | |
| 300 + "src/google/protobuf/compiler/code_generator.cc", | |
| 301 + "src/google/protobuf/compiler/code_generator.h", | |
| 302 + "src/google/protobuf/compiler/command_line_interface.cc", | |
| 303 + "src/google/protobuf/compiler/command_line_interface.h", | |
| 304 + "src/google/protobuf/compiler/cpp/cpp_enum.cc", | |
| 305 + "src/google/protobuf/compiler/cpp/cpp_enum.h", | |
| 306 + "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", | |
| 307 + "src/google/protobuf/compiler/cpp/cpp_enum_field.h", | |
| 308 + "src/google/protobuf/compiler/cpp/cpp_extension.cc", | |
| 309 + "src/google/protobuf/compiler/cpp/cpp_extension.h", | |
| 310 + "src/google/protobuf/compiler/cpp/cpp_field.cc", | |
| 311 + "src/google/protobuf/compiler/cpp/cpp_field.h", | |
| 312 + "src/google/protobuf/compiler/cpp/cpp_file.cc", | |
| 313 + "src/google/protobuf/compiler/cpp/cpp_file.h", | |
| 314 + "src/google/protobuf/compiler/cpp/cpp_generator.cc", | |
| 315 + "src/google/protobuf/compiler/cpp/cpp_generator.h", | |
| 316 + "src/google/protobuf/compiler/cpp/cpp_helpers.cc", | |
| 317 + "src/google/protobuf/compiler/cpp/cpp_helpers.h", | |
| 318 + "src/google/protobuf/compiler/cpp/cpp_map_field.cc", | |
| 319 + "src/google/protobuf/compiler/cpp/cpp_map_field.h", | |
| 320 + "src/google/protobuf/compiler/cpp/cpp_message.cc", | |
| 321 + "src/google/protobuf/compiler/cpp/cpp_message.h", | |
| 322 + "src/google/protobuf/compiler/cpp/cpp_message_field.cc", | |
| 323 + "src/google/protobuf/compiler/cpp/cpp_message_field.h", | |
| 324 + "src/google/protobuf/compiler/cpp/cpp_options.h", | |
| 325 + "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", | |
| 326 + "src/google/protobuf/compiler/cpp/cpp_primitive_field.h", | |
| 327 + "src/google/protobuf/compiler/cpp/cpp_service.cc", | |
| 328 + "src/google/protobuf/compiler/cpp/cpp_service.h", | |
| 329 + "src/google/protobuf/compiler/cpp/cpp_string_field.cc", | |
| 330 + "src/google/protobuf/compiler/cpp/cpp_string_field.h", | |
| 331 + "src/google/protobuf/compiler/csharp/csharp_enum.cc", | |
| 332 + "src/google/protobuf/compiler/csharp/csharp_enum.h", | |
| 333 + "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", | |
| 334 + "src/google/protobuf/compiler/csharp/csharp_enum_field.h", | |
| 335 + "src/google/protobuf/compiler/csharp/csharp_field_base.cc", | |
| 336 + "src/google/protobuf/compiler/csharp/csharp_field_base.h", | |
| 337 + "src/google/protobuf/compiler/csharp/csharp_generator.cc", | |
| 338 + "src/google/protobuf/compiler/csharp/csharp_generator.h", | |
| 339 + "src/google/protobuf/compiler/csharp/csharp_helpers.cc", | |
| 340 + "src/google/protobuf/compiler/csharp/csharp_helpers.h", | |
| 341 + "src/google/protobuf/compiler/csharp/csharp_map_field.cc", | |
| 342 + "src/google/protobuf/compiler/csharp/csharp_map_field.h", | |
| 343 + "src/google/protobuf/compiler/csharp/csharp_message.cc", | |
| 344 + "src/google/protobuf/compiler/csharp/csharp_message.h", | |
| 345 + "src/google/protobuf/compiler/csharp/csharp_message_field.cc", | |
| 346 + "src/google/protobuf/compiler/csharp/csharp_message_field.h", | |
| 347 + "src/google/protobuf/compiler/csharp/csharp_names.h", | |
| 348 + "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", | |
| 349 + "src/google/protobuf/compiler/csharp/csharp_primitive_field.h", | |
| 350 + "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", | |
| 351 + "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h", | |
| 352 + "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", | |
| 353 + "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h", | |
| 354 + "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", | |
| 355 + "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h", | |
| 356 + "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", | |
| 357 + "src/google/protobuf/compiler/csharp/csharp_source_generator_base.h", | |
| 358 + "src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc", | |
| 359 + "src/google/protobuf/compiler/csharp/csharp_umbrella_class.h", | |
| 360 + "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", | |
| 361 + "src/google/protobuf/compiler/csharp/csharp_wrapper_field.h", | |
| 362 + "src/google/protobuf/compiler/java/java_context.cc", | |
| 363 + "src/google/protobuf/compiler/java/java_context.h", | |
| 364 + "src/google/protobuf/compiler/java/java_doc_comment.cc", | |
| 365 + "src/google/protobuf/compiler/java/java_doc_comment.h", | |
| 366 + "src/google/protobuf/compiler/java/java_enum.cc", | |
| 367 + "src/google/protobuf/compiler/java/java_enum.h", | |
| 368 + "src/google/protobuf/compiler/java/java_enum_field.cc", | |
| 369 + "src/google/protobuf/compiler/java/java_enum_field.h", | |
| 370 + "src/google/protobuf/compiler/java/java_enum_field_lite.cc", | |
| 371 + "src/google/protobuf/compiler/java/java_enum_field_lite.h", | |
| 372 + "src/google/protobuf/compiler/java/java_extension.cc", | |
| 373 + "src/google/protobuf/compiler/java/java_extension.h", | |
| 374 + "src/google/protobuf/compiler/java/java_field.cc", | |
| 375 + "src/google/protobuf/compiler/java/java_field.h", | |
| 376 + "src/google/protobuf/compiler/java/java_file.cc", | |
| 377 + "src/google/protobuf/compiler/java/java_file.h", | |
| 378 + "src/google/protobuf/compiler/java/java_generator.cc", | |
| 379 + "src/google/protobuf/compiler/java/java_generator.h", | |
| 380 + "src/google/protobuf/compiler/java/java_generator_factory.cc", | |
| 381 + "src/google/protobuf/compiler/java/java_generator_factory.h", | |
| 382 + "src/google/protobuf/compiler/java/java_helpers.cc", | |
| 383 + "src/google/protobuf/compiler/java/java_helpers.h", | |
| 384 + "src/google/protobuf/compiler/java/java_lazy_message_field.cc", | |
| 385 + "src/google/protobuf/compiler/java/java_lazy_message_field.h", | |
| 386 + "src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc", | |
| 387 + "src/google/protobuf/compiler/java/java_lazy_message_field_lite.h", | |
| 388 + "src/google/protobuf/compiler/java/java_map_field.cc", | |
| 389 + "src/google/protobuf/compiler/java/java_map_field.h", | |
| 390 + "src/google/protobuf/compiler/java/java_map_field_lite.cc", | |
| 391 + "src/google/protobuf/compiler/java/java_map_field_lite.h", | |
| 392 + "src/google/protobuf/compiler/java/java_message.cc", | |
| 393 + "src/google/protobuf/compiler/java/java_message.h", | |
| 394 + "src/google/protobuf/compiler/java/java_message_builder.cc", | |
| 395 + "src/google/protobuf/compiler/java/java_message_builder.h", | |
| 396 + "src/google/protobuf/compiler/java/java_message_builder_lite.cc", | |
| 397 + "src/google/protobuf/compiler/java/java_message_builder_lite.h", | |
| 398 + "src/google/protobuf/compiler/java/java_message_field.cc", | |
| 399 + "src/google/protobuf/compiler/java/java_message_field.h", | |
| 400 + "src/google/protobuf/compiler/java/java_message_field_lite.cc", | |
| 401 + "src/google/protobuf/compiler/java/java_message_field_lite.h", | |
| 402 + "src/google/protobuf/compiler/java/java_message_lite.cc", | |
| 403 + "src/google/protobuf/compiler/java/java_message_lite.h", | |
| 404 + "src/google/protobuf/compiler/java/java_name_resolver.cc", | |
| 405 + "src/google/protobuf/compiler/java/java_name_resolver.h", | |
| 406 + "src/google/protobuf/compiler/java/java_primitive_field.cc", | |
| 407 + "src/google/protobuf/compiler/java/java_primitive_field.h", | |
| 408 + "src/google/protobuf/compiler/java/java_primitive_field_lite.cc", | |
| 409 + "src/google/protobuf/compiler/java/java_primitive_field_lite.h", | |
| 410 + "src/google/protobuf/compiler/java/java_service.cc", | |
| 411 + "src/google/protobuf/compiler/java/java_service.h", | |
| 412 + "src/google/protobuf/compiler/java/java_shared_code_generator.cc", | |
| 413 + "src/google/protobuf/compiler/java/java_shared_code_generator.h", | |
| 414 + "src/google/protobuf/compiler/java/java_string_field.cc", | |
| 415 + "src/google/protobuf/compiler/java/java_string_field.h", | |
| 416 + "src/google/protobuf/compiler/java/java_string_field_lite.cc", | |
| 417 + "src/google/protobuf/compiler/java/java_string_field_lite.h", | |
| 418 + "src/google/protobuf/compiler/javanano/javanano_enum.cc", | |
| 419 + "src/google/protobuf/compiler/javanano/javanano_enum.h", | |
| 420 + "src/google/protobuf/compiler/javanano/javanano_enum_field.cc", | |
| 421 + "src/google/protobuf/compiler/javanano/javanano_enum_field.h", | |
| 422 + "src/google/protobuf/compiler/javanano/javanano_extension.cc", | |
| 423 + "src/google/protobuf/compiler/javanano/javanano_extension.h", | |
| 424 + "src/google/protobuf/compiler/javanano/javanano_field.cc", | |
| 425 + "src/google/protobuf/compiler/javanano/javanano_field.h", | |
| 426 + "src/google/protobuf/compiler/javanano/javanano_file.cc", | |
| 427 + "src/google/protobuf/compiler/javanano/javanano_file.h", | |
| 428 + "src/google/protobuf/compiler/javanano/javanano_generator.cc", | |
| 429 + "src/google/protobuf/compiler/javanano/javanano_generator.h", | |
| 430 + "src/google/protobuf/compiler/javanano/javanano_helpers.cc", | |
| 431 + "src/google/protobuf/compiler/javanano/javanano_helpers.h", | |
| 432 + "src/google/protobuf/compiler/javanano/javanano_map_field.cc", | |
| 433 + "src/google/protobuf/compiler/javanano/javanano_map_field.h", | |
| 434 + "src/google/protobuf/compiler/javanano/javanano_message.cc", | |
| 435 + "src/google/protobuf/compiler/javanano/javanano_message.h", | |
| 436 + "src/google/protobuf/compiler/javanano/javanano_message_field.cc", | |
| 437 + "src/google/protobuf/compiler/javanano/javanano_message_field.h", | |
| 438 + "src/google/protobuf/compiler/javanano/javanano_params.h", | |
| 439 + "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", | |
| 440 + "src/google/protobuf/compiler/javanano/javanano_primitive_field.h", | |
| 441 + "src/google/protobuf/compiler/main.cc", | |
| 442 + "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", | |
| 443 + "src/google/protobuf/compiler/objectivec/objectivec_enum.h", | |
| 444 + "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", | |
| 445 + "src/google/protobuf/compiler/objectivec/objectivec_enum_field.h", | |
| 446 + "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", | |
| 447 + "src/google/protobuf/compiler/objectivec/objectivec_extension.h", | |
| 448 + "src/google/protobuf/compiler/objectivec/objectivec_field.cc", | |
| 449 + "src/google/protobuf/compiler/objectivec/objectivec_field.h", | |
| 450 + "src/google/protobuf/compiler/objectivec/objectivec_file.cc", | |
| 451 + "src/google/protobuf/compiler/objectivec/objectivec_file.h", | |
| 452 + "src/google/protobuf/compiler/objectivec/objectivec_generator.cc", | |
| 453 + "src/google/protobuf/compiler/objectivec/objectivec_generator.h", | |
| 454 + "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", | |
| 455 + "src/google/protobuf/compiler/objectivec/objectivec_helpers.h", | |
| 456 + "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", | |
| 457 + "src/google/protobuf/compiler/objectivec/objectivec_map_field.h", | |
| 458 + "src/google/protobuf/compiler/objectivec/objectivec_message.cc", | |
| 459 + "src/google/protobuf/compiler/objectivec/objectivec_message.h", | |
| 460 + "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", | |
| 461 + "src/google/protobuf/compiler/objectivec/objectivec_message_field.h", | |
| 462 + "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", | |
| 463 + "src/google/protobuf/compiler/objectivec/objectivec_oneof.h", | |
| 464 + "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", | |
| 465 + "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h", | |
| 466 + "src/google/protobuf/compiler/plugin.cc", | |
| 467 + "src/google/protobuf/compiler/plugin.h", | |
| 468 + "src/google/protobuf/compiler/plugin.pb.cc", | |
| 469 + "src/google/protobuf/compiler/plugin.pb.h", | |
| 470 + "src/google/protobuf/compiler/python/python_generator.cc", | |
| 471 + "src/google/protobuf/compiler/python/python_generator.h", | |
| 472 + "src/google/protobuf/compiler/ruby/ruby_generator.cc", | |
| 473 + "src/google/protobuf/compiler/ruby/ruby_generator.h", | |
| 474 + "src/google/protobuf/compiler/subprocess.cc", | |
| 475 + "src/google/protobuf/compiler/subprocess.h", | |
| 476 + "src/google/protobuf/compiler/zip_writer.cc", | |
| 477 + "src/google/protobuf/compiler/zip_writer.h", | |
| 478 + ] | |
| 479 + | |
| 480 + configs -= [ "//build/config/compiler:chromium_code" ] | |
| 481 + configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 482 + if (is_win) { | |
| 483 + # This is defined internally, don't warn on duplicate. | |
| 484 + configs -= [ "//build/config/win:lean_and_mean" ] | |
| 485 + } | |
| 486 + | |
| 487 + cflags = protobuf_lite_cflags | |
| 488 + | |
| 489 + deps = [ | |
| 490 + ":protobuf_full", | |
| 491 + ] | |
| 492 + deps += [ "//build/config/sanitizers:deps" ] | |
| 493 + } | |
| 494 +} | |
| 495 + | |
| 496 +google_python_dir = "$root_out_dir/pyproto/google" | |
| 497 + | |
| 498 +copy("copy_google") { | |
| 499 + sources = [ | |
| 500 + "python/google/__init__.py", | |
| 501 + ] | |
| 502 + outputs = [ | |
| 503 + "$google_python_dir/{{source_file_part}}", | |
| 504 + ] | |
| 505 +} | |
| 506 + | |
| 507 +copy("copy_google_protobuf") { | |
| 508 + sources = [ | |
| 509 + "python/google/protobuf/__init__.py", | |
| 510 + "python/google/protobuf/descriptor.py", | |
| 511 + "python/google/protobuf/descriptor_database.py", | |
| 512 + | |
| 513 + # TODO(ncarter): protoc's python generator treats descriptor.proto | |
| 514 + # specially, but only when the input path is exactly | |
| 515 + # "google/protobuf/descriptor.proto". I'm not sure how to execute a rule | |
| 516 + # from a different directory. For now, use a manually-generated copy of | |
| 517 + # descriptor_pb2.py. | |
| 518 + "python/google/protobuf/descriptor_pb2.py", | |
| 519 + "python/google/protobuf/descriptor_pool.py", | |
| 520 + "python/google/protobuf/message.py", | |
| 521 + "python/google/protobuf/message_factory.py", | |
| 522 + "python/google/protobuf/proto_builder.py", | |
| 523 + "python/google/protobuf/reflection.py", | |
| 524 + "python/google/protobuf/service.py", | |
| 525 + "python/google/protobuf/service_reflection.py", | |
| 526 + "python/google/protobuf/symbol_database.py", | |
| 527 + "python/google/protobuf/text_encoding.py", | |
| 528 + "python/google/protobuf/text_format.py", | |
| 529 + ] | |
| 530 + outputs = [ | |
| 531 + "$google_python_dir/protobuf/{{source_file_part}}", | |
| 532 + ] | |
| 533 +} | |
| 534 + | |
| 535 +copy("copy_google_protobuf_internal") { | |
| 536 + sources = [ | |
| 537 + "python/google/protobuf/internal/__init__.py", | |
| 538 + "python/google/protobuf/internal/api_implementation.py", | |
| 539 + "python/google/protobuf/internal/containers.py", | |
| 540 + "python/google/protobuf/internal/decoder.py", | |
| 541 + "python/google/protobuf/internal/encoder.py", | |
| 542 + "python/google/protobuf/internal/enum_type_wrapper.py", | |
| 543 + "python/google/protobuf/internal/generator_test.py", | |
| 544 + "python/google/protobuf/internal/message_listener.py", | |
| 545 + "python/google/protobuf/internal/python_message.py", | |
| 546 + "python/google/protobuf/internal/type_checkers.py", | |
| 547 + "python/google/protobuf/internal/wire_format.py", | |
| 548 + ] | |
| 549 + outputs = [ | |
| 550 + "$google_python_dir/protobuf/internal/{{source_file_part}}", | |
| 551 + ] | |
| 552 +} | |
| 553 + | |
| 554 +copy("copy_google_protobuf_pyext") { | |
| 555 + sources = [ | |
| 556 + "python/google/protobuf/pyext/__init__.py", | |
| 557 + "python/google/protobuf/pyext/cpp_message.py", | |
| 558 + ] | |
| 559 + outputs = [ | |
| 560 + "$google_python_dir/protobuf/pyext/{{source_file_part}}", | |
| 561 + ] | |
| 562 +} | |
| 563 + | |
| 564 +group("py_proto") { | |
| 565 + public_deps = [ | |
| 566 + ":copy_google", | |
| 567 + ":copy_google_protobuf", | |
| 568 + ":copy_google_protobuf_internal", | |
| 569 + ] | |
| 570 + | |
| 571 + # Targets that depend on this should depend on the copied data files. | |
| 572 + data = get_target_outputs(":copy_google") | |
| 573 + data += get_target_outputs(":copy_google_protobuf") | |
| 574 + data += get_target_outputs(":copy_google_protobuf_internal") | |
| 575 +} | |
| 576 diff --git a/third_party/protobuf/DEPS b/third_party/protobuf/DEPS | |
| 577 new file mode 100644 | |
| 578 index 0000000..2155370 | |
| 579 --- /dev/null | |
| 580 +++ b/third_party/protobuf/DEPS | |
| 581 @@ -0,0 +1,4 @@ | |
| 582 +include_rules = [ | |
| 583 + '+google/protobuf', | |
| 584 + '+net/proto', # Bogus include in upstream sources. | |
| 585 +] | |
| 586 diff --git a/third_party/protobuf/OWNERS b/third_party/protobuf/OWNERS | |
| 587 new file mode 100644 | |
| 588 index 0000000..07e9671 | |
| 589 --- /dev/null | |
| 590 +++ b/third_party/protobuf/OWNERS | |
| 591 @@ -0,0 +1,2 @@ | |
| 592 +agl@chromium.org | |
| 593 +pkasting@chromium.org | |
| 594 diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README.
chromium | |
| 595 new file mode 100644 | |
| 596 index 0000000..0375fd1 | |
| 597 --- /dev/null | |
| 598 +++ b/third_party/protobuf/README.chromium | |
| 599 @@ -0,0 +1,32 @@ | |
| 600 +Name: Protocol Buffers | |
| 601 +Short Name: protobuf | |
| 602 +URL: https://github.com/google/protobuf | |
| 603 +License: BSD | |
| 604 +License File: LICENSE | |
| 605 +Version: unknown | |
| 606 +Revision: 6994b07f1480f658e2ea6262f8ca804e836ef1d2 | |
| 607 +Security Critical: yes | |
| 608 + | |
| 609 +Steps used to create the current version: | |
| 610 +(1) Download and unpack protobuf sources from | |
| 611 + https://github.com/google/protobuf/archive/master.zip . | |
| 612 +(2) Apply the patches in patches/ in order. In all these cases, after | |
| 613 + determining how to adapt the patch to the current protobuf codebase, you | |
| 614 + should regenerate the patch for the next maintainer. | |
| 615 + | |
| 616 + A brief description of each patch: | |
| 617 + 00: Add initial GYP/GN buildfiles, DEPS, OWNERS, and README.chromium. You | |
| 618 + will need to modify the README to include the correct revision, and modif
y | |
| 619 + the buildfiles to reflect the actual files in the source tree, what they | |
| 620 + #include, what warnings they trigger, etc. | |
| 621 +(3) Generate descriptor_pb2.py using something like the following steps. Make | |
| 622 + sure you've regenerated your buildfiles and will build protoc from the | |
| 623 + newly-modified sources above. | |
| 624 + $ cd $SRC_DIR | |
| 625 + $ ninja -C out/Debug protoc | |
| 626 + $ cd third_party/protobuf/src | |
| 627 + $ ../../../out/Debug/protoc --python_out=../python google/protobuf/descriptor
.proto | |
| 628 + $ cd .. | |
| 629 + $ git add -f python/google/protobuf/descriptor_pb2.py | |
| 630 + $ git commit | |
| 631 +(4) At this point you should be done, and able to successfully build everything
. | |
| 632 diff --git a/third_party/protobuf/proto_library.gni b/third_party/protobuf/proto
_library.gni | |
| 633 new file mode 100644 | |
| 634 index 0000000..8e7ea14 | |
| 635 --- /dev/null | |
| 636 +++ b/third_party/protobuf/proto_library.gni | |
| 637 @@ -0,0 +1,175 @@ | |
| 638 +# Copyright 2014 The Chromium Authors. All rights reserved. | |
| 639 +# Use of this source code is governed by a BSD-style license that can be | |
| 640 +# found in the LICENSE file. | |
| 641 + | |
| 642 +# Compile a protocol buffer. | |
| 643 +# | |
| 644 +# Protobuf parameters: | |
| 645 +# | |
| 646 +# proto_out_dir (optional) | |
| 647 +# Specifies the path suffix that output files are generated under. This | |
| 648 +# path will be appended to the root_gen_dir. | |
| 649 +# | |
| 650 +# Targets that depend on the proto target will be able to include the | |
| 651 +# resulting proto headers with an include like: | |
| 652 +# #include "dir/for/my_proto_lib/foo.pb.h" | |
| 653 +# If undefined, this defaults to matching the input directory for each | |
| 654 +# .proto file (you should almost always use the default mode). | |
| 655 +# | |
| 656 +# cc_generator_options (optional) | |
| 657 +# List of extra flags passed to the protocol compiler. If you need to | |
| 658 +# add an EXPORT macro to a protobuf's C++ header, set the | |
| 659 +# 'cc_generator_options' variable with the value: | |
| 660 +# 'dllexport_decl=FOO_EXPORT:' (note trailing colon). | |
| 661 +# | |
| 662 +# It is likely you also need to #include a file for the above EXPORT | |
| 663 +# macro to work. See cc_include. | |
| 664 +# | |
| 665 +# cc_include (optional) | |
| 666 +# String listing an extra include that should be passed. | |
| 667 +# Example: cc_include = "foo/bar.h" | |
| 668 +# | |
| 669 +# deps (optional) | |
| 670 +# Additional dependencies. | |
| 671 +# | |
| 672 +# Parameters for compiling the generated code: | |
| 673 +# | |
| 674 +# defines (optional) | |
| 675 +# Defines to supply to the source set that compiles the generated source | |
| 676 +# code. | |
| 677 +# | |
| 678 +# extra_configs (optional) | |
| 679 +# A list of config labels that will be appended to the configs applying | |
| 680 +# to the source set. | |
| 681 +# | |
| 682 +# Example: | |
| 683 +# proto_library("mylib") { | |
| 684 +# sources = [ | |
| 685 +# "foo.proto", | |
| 686 +# ] | |
| 687 +# } | |
| 688 + | |
| 689 +template("proto_library") { | |
| 690 + assert(defined(invoker.sources), "Need sources for proto_library") | |
| 691 + | |
| 692 + # Don't apply OS-specific sources filtering to the assignments later on. | |
| 693 + # Platform files should have gotten filtered out in the sources assignment | |
| 694 + # when this template was invoked. If they weren't, it was on purpose and | |
| 695 + # this template shouldn't re-apply the filter. | |
| 696 + set_sources_assignment_filter([]) | |
| 697 + | |
| 698 + action_name = "${target_name}_gen" | |
| 699 + source_set_name = target_name | |
| 700 + action_foreach(action_name) { | |
| 701 + visibility = [ ":$source_set_name" ] | |
| 702 + | |
| 703 + script = "//tools/protoc_wrapper/protoc_wrapper.py" | |
| 704 + | |
| 705 + sources = invoker.sources | |
| 706 + | |
| 707 + # Compute the output directory, both relative to the source root (for | |
| 708 + # declaring "outputs") and relative to the build dir (for passing to the | |
| 709 + # script). | |
| 710 + if (defined(invoker.proto_out_dir)) { | |
| 711 + # Put the results in the specified dir in the gen tree. | |
| 712 + out_dir = "$root_gen_dir/" + invoker.proto_out_dir | |
| 713 + rel_out_dir = rebase_path(out_dir, root_build_dir) | |
| 714 + py_out_dir = "$root_out_dir/pyproto/" + invoker.proto_out_dir | |
| 715 + } else { | |
| 716 + # Use the gen directory corresponding to the source file for C++ sources. | |
| 717 + # This expansion will be done differently in the outputs and the args, so | |
| 718 + # we don't need to worry about rebasing as above. Always put Python | |
| 719 + # sources in "pyproto". | |
| 720 + out_dir = "{{source_gen_dir}}" | |
| 721 + rel_out_dir = "{{source_gen_dir}}" | |
| 722 + py_out_dir = "$root_out_dir/pyproto/{{source_root_relative_dir}}" | |
| 723 + } | |
| 724 + rel_py_out_dir = rebase_path(py_out_dir, root_build_dir) | |
| 725 + | |
| 726 + outputs = [ | |
| 727 + "$py_out_dir/{{source_name_part}}_pb2.py", | |
| 728 + "$out_dir/{{source_name_part}}.pb.cc", | |
| 729 + "$out_dir/{{source_name_part}}.pb.h", | |
| 730 + ] | |
| 731 + | |
| 732 + args = [] | |
| 733 + if (defined(invoker.cc_include)) { | |
| 734 + args += [ | |
| 735 + "--include", | |
| 736 + invoker.cc_include, | |
| 737 + ] | |
| 738 + } | |
| 739 + | |
| 740 + args += [ | |
| 741 + "--protobuf", | |
| 742 + "$rel_out_dir/{{source_name_part}}.pb.h", | |
| 743 + "--proto-in-dir", | |
| 744 + "{{source_dir}}", | |
| 745 + "--proto-in-file", | |
| 746 + "{{source_file_part}}", | |
| 747 + | |
| 748 + # TODO(brettw) support system protobuf compiler. | |
| 749 + "--use-system-protobuf=0", | |
| 750 + ] | |
| 751 + | |
| 752 + protoc_label = "//third_party/protobuf:protoc($host_toolchain)" | |
| 753 + args += [ | |
| 754 + "--", | |
| 755 + | |
| 756 + # Prepend with "./" so this will never pick up the system one (normally | |
| 757 + # when not cross-compiling, protoc's output directory will be the same | |
| 758 + # as the build dir, so the relative location will be empty). | |
| 759 + "./" + | |
| 760 + rebase_path(get_label_info(protoc_label, "root_out_dir") + "/protoc", | |
| 761 + root_build_dir), | |
| 762 + ] | |
| 763 + | |
| 764 + # If passed cc_generator_options should end in a colon, which will separate | |
| 765 + # it from the directory when we concatenate them. The proto compiler | |
| 766 + # understands this syntax. | |
| 767 + if (defined(invoker.cc_generator_options)) { | |
| 768 + cc_generator_options = invoker.cc_generator_options | |
| 769 + } else { | |
| 770 + cc_generator_options = "" | |
| 771 + } | |
| 772 + args += [ | |
| 773 + # cc_generator_options is supposed to end in a colon if it's nonempty. | |
| 774 + "--cpp_out", | |
| 775 + "$cc_generator_options$rel_out_dir", | |
| 776 + "--python_out", | |
| 777 + rel_py_out_dir, | |
| 778 + ] | |
| 779 + | |
| 780 + deps = [ | |
| 781 + protoc_label, | |
| 782 + ] | |
| 783 + if (defined(invoker.deps)) { | |
| 784 + deps += invoker.deps | |
| 785 + } | |
| 786 + } | |
| 787 + | |
| 788 + source_set(target_name) { | |
| 789 + forward_variables_from(invoker, | |
| 790 + [ | |
| 791 + "visibility", | |
| 792 + "defines", | |
| 793 + ]) | |
| 794 + | |
| 795 + sources = get_target_outputs(":$action_name") | |
| 796 + | |
| 797 + if (defined(invoker.extra_configs)) { | |
| 798 + configs += invoker.extra_configs | |
| 799 + } | |
| 800 + | |
| 801 + public_configs = [ "//third_party/protobuf:using_proto" ] | |
| 802 + | |
| 803 + public_deps = [ | |
| 804 + # The generated headers reference headers within protobuf_lite, so | |
| 805 + # dependencies must be able to find those headers too. | |
| 806 + "//third_party/protobuf:protobuf_lite", | |
| 807 + ] | |
| 808 + deps = [ | |
| 809 + ":$action_name", | |
| 810 + ] | |
| 811 + } | |
| 812 +} | |
| 813 diff --git a/third_party/protobuf/protobuf.gyp b/third_party/protobuf/protobuf.g
yp | |
| 814 new file mode 100644 | |
| 815 index 0000000..e839ad7 | |
| 816 --- /dev/null | |
| 817 +++ b/third_party/protobuf/protobuf.gyp | |
| 818 @@ -0,0 +1,553 @@ | |
| 819 +# Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 820 +# Use of this source code is governed by a BSD-style license that can be | |
| 821 +# found in the LICENSE file. | |
| 822 + | |
| 823 +{ | |
| 824 + 'conditions': [ | |
| 825 + ['use_system_protobuf==0', { | |
| 826 + 'target_defaults': { | |
| 827 + 'conditions': [ | |
| 828 + ['OS=="win"', { | |
| 829 + 'msvs_disabled_warnings': [ | |
| 830 + 4018, # signed/unsigned mismatch in comparison | |
| 831 + 4065, # switch statement contains 'default' but no 'case' labels | |
| 832 + 4146, # unary minus operator applied to unsigned type | |
| 833 + 4244, # implicit conversion, possible loss of data | |
| 834 + 4267, # size_t to int truncation | |
| 835 + 4291, # no matching operator delete for a placement new | |
| 836 + 4355, # 'this' used in base member initializer list | |
| 837 + 4506, # no definition for inline function | |
| 838 + ], | |
| 839 + 'defines!': [ | |
| 840 + 'WIN32_LEAN_AND_MEAN', # Protobuf defines this itself. | |
| 841 + ], | |
| 842 + }], | |
| 843 + ['OS=="mac" or OS=="ios"', { | |
| 844 + 'defines': [ | |
| 845 + # Chromium builds don't yet support __thread on Mac -- not sure i
f | |
| 846 + # the limiting factor is using libc++ or having OS X >=10.7. | |
| 847 + # Remove this for Mac once the above aren't issues. | |
| 848 + # | |
| 849 + # The "ios" bit is for host binaries built on the Mac as part of | |
| 850 + # the iOS build process -- target binaries would work anyway due | |
| 851 + # to the preprocessor checks for iOS in the codebase. What we | |
| 852 + # really want is something like | |
| 853 + # '_toolchain="host" and host_os=="mac"', but host_os isn't | |
| 854 + # properly defined in all cases, and it's not worth trying to fix | |
| 855 + # it, especially since we can do this more correctly in GN. | |
| 856 + 'GOOGLE_PROTOBUF_NO_THREADLOCAL', | |
| 857 + ], | |
| 858 + }], | |
| 859 + ], | |
| 860 + }, | |
| 861 + 'conditions': [ | |
| 862 + ['OS=="ios" and "<(GENERATOR)"=="xcode" and "<(GENERATOR_FLAVOR)"!="nin
ja"', { | |
| 863 + 'variables': { | |
| 864 + 'ninja_output_dir': 'ninja-protoc', | |
| 865 + 'ninja_product_dir': | |
| 866 + '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)', | |
| 867 + # Gyp to rerun | |
| 868 + 're_run_targets': [ | |
| 869 + 'third_party/protobuf/protobuf.gyp', | |
| 870 + ], | |
| 871 + }, | |
| 872 + 'targets': [ | |
| 873 + { | |
| 874 + # On iOS, generating protoc is done via two actions: (1) compilin
g | |
| 875 + # the executable with ninja, and (2) copying the executable into
a | |
| 876 + # location that is shared with other projects. These actions are | |
| 877 + # separated into two targets in order to be able to specify that
the | |
| 878 + # second action should not run until the first action finishes (s
ince | |
| 879 + # the ordering of multiple actions in one target is defined only
by | |
| 880 + # inputs and outputs, and it's impossible to set correct inputs f
or | |
| 881 + # the ninja build, so setting all the inputs and outputs isn't an | |
| 882 + # option). The first target is given here; the second target is t
he | |
| 883 + # normal protoc target under the condition that "OS==iOS". | |
| 884 + 'target_name': 'compile_protoc', | |
| 885 + 'type': 'none', | |
| 886 + 'toolsets': ['host'], | |
| 887 + 'includes': ['../../build/ios/mac_build.gypi'], | |
| 888 + 'actions': [ | |
| 889 + { | |
| 890 + 'action_name': 'compile protoc', | |
| 891 + 'inputs': [], | |
| 892 + 'outputs': [], | |
| 893 + 'action': [ | |
| 894 + '<@(ninja_cmd)', | |
| 895 + 'protoc', | |
| 896 + ], | |
| 897 + 'message': 'Generating the C++ protocol buffers compiler', | |
| 898 + }, | |
| 899 + ], | |
| 900 + }, | |
| 901 + ], | |
| 902 + }], | |
| 903 + ], | |
| 904 + 'targets': [ | |
| 905 + # The "lite" lib is about 1/7th the size of the heavy lib, | |
| 906 + # but it doesn't support some of the more exotic features of | |
| 907 + # protobufs, like reflection. To generate C++ code that can link | |
| 908 + # against the lite version of the library, add the option line: | |
| 909 + # | |
| 910 + # option optimize_for = LITE_RUNTIME; | |
| 911 + # | |
| 912 + # to your .proto file. | |
| 913 + { | |
| 914 + 'target_name': 'protobuf_lite', | |
| 915 + 'type': 'static_library', | |
| 916 + 'toolsets': ['host', 'target'], | |
| 917 + 'includes': [ | |
| 918 + 'protobuf_lite.gypi', | |
| 919 + ], | |
| 920 + }, | |
| 921 + # This is the full, heavy protobuf lib that's needed for c++ .protos | |
| 922 + # that don't specify the LITE_RUNTIME option. The protocol | |
| 923 + # compiler itself (protoc) falls into that category. | |
| 924 + # | |
| 925 + # DO NOT LINK AGAINST THIS TARGET IN CHROME CODE --agl | |
| 926 + { | |
| 927 + 'target_name': 'protobuf_full_do_not_use', | |
| 928 + 'type': 'static_library', | |
| 929 + 'toolsets': ['host','target'], | |
| 930 + 'sources': [ | |
| 931 + 'src/google/protobuf/any.cc', | |
| 932 + 'src/google/protobuf/any.h', | |
| 933 + 'src/google/protobuf/any.pb.cc', | |
| 934 + 'src/google/protobuf/any.pb.h', | |
| 935 + 'src/google/protobuf/api.pb.cc', | |
| 936 + 'src/google/protobuf/api.pb.h', | |
| 937 + 'src/google/protobuf/compiler/importer.cc', | |
| 938 + 'src/google/protobuf/compiler/importer.h', | |
| 939 + 'src/google/protobuf/compiler/parser.cc', | |
| 940 + 'src/google/protobuf/compiler/parser.h', | |
| 941 + 'src/google/protobuf/descriptor.cc', | |
| 942 + 'src/google/protobuf/descriptor.pb.cc', | |
| 943 + 'src/google/protobuf/descriptor_database.cc', | |
| 944 + 'src/google/protobuf/descriptor_database.h', | |
| 945 + 'src/google/protobuf/duration.pb.cc', | |
| 946 + 'src/google/protobuf/duration.pb.h', | |
| 947 + 'src/google/protobuf/dynamic_message.cc', | |
| 948 + 'src/google/protobuf/dynamic_message.h', | |
| 949 + 'src/google/protobuf/empty.pb.cc', | |
| 950 + 'src/google/protobuf/empty.pb.h', | |
| 951 + 'src/google/protobuf/extension_set_heavy.cc', | |
| 952 + 'src/google/protobuf/field_mask.pb.cc', | |
| 953 + 'src/google/protobuf/field_mask.pb.h', | |
| 954 + 'src/google/protobuf/generated_message_reflection.cc', | |
| 955 + 'src/google/protobuf/generated_message_reflection.h', | |
| 956 + # gzip_stream.cc pulls in zlib, but it's not actually used by | |
| 957 + # protoc, just by test code; so instead of compiling zlib for the | |
| 958 + # host, let's just exclude these. | |
| 959 + # 'src/google/protobuf/io/gzip_stream.cc', | |
| 960 + # 'src/google/protobuf/io/gzip_stream.h', | |
| 961 + 'src/google/protobuf/io/printer.cc', | |
| 962 + 'src/google/protobuf/io/printer.h', | |
| 963 + 'src/google/protobuf/io/strtod.cc', | |
| 964 + 'src/google/protobuf/io/strtod.h', | |
| 965 + 'src/google/protobuf/io/tokenizer.cc', | |
| 966 + 'src/google/protobuf/io/tokenizer.h', | |
| 967 + 'src/google/protobuf/io/zero_copy_stream_impl.cc', | |
| 968 + 'src/google/protobuf/io/zero_copy_stream_impl.h', | |
| 969 + 'src/google/protobuf/map.h', | |
| 970 + 'src/google/protobuf/map_entry_lite.h', | |
| 971 + 'src/google/protobuf/map_field.cc', | |
| 972 + 'src/google/protobuf/map_field.h', | |
| 973 + 'src/google/protobuf/map_field_inl.h', | |
| 974 + 'src/google/protobuf/map_field_lite.h', | |
| 975 + 'src/google/protobuf/map_type_handler.h', | |
| 976 + 'src/google/protobuf/message.cc', | |
| 977 + 'src/google/protobuf/reflection_ops.cc', | |
| 978 + 'src/google/protobuf/reflection_ops.h', | |
| 979 + 'src/google/protobuf/service.cc', | |
| 980 + 'src/google/protobuf/service.h', | |
| 981 + 'src/google/protobuf/source_context.pb.cc', | |
| 982 + 'src/google/protobuf/source_context.pb.h', | |
| 983 + 'src/google/protobuf/struct.pb.cc', | |
| 984 + 'src/google/protobuf/struct.pb.h', | |
| 985 + 'src/google/protobuf/stubs/mathlimits.cc', | |
| 986 + 'src/google/protobuf/stubs/mathutil.h', | |
| 987 + 'src/google/protobuf/stubs/shared_ptr.h', | |
| 988 + 'src/google/protobuf/stubs/singleton.h', | |
| 989 + 'src/google/protobuf/stubs/status_macros.h', | |
| 990 + 'src/google/protobuf/stubs/structurally_valid.cc', | |
| 991 + 'src/google/protobuf/stubs/substitute.cc', | |
| 992 + 'src/google/protobuf/stubs/substitute.h', | |
| 993 + 'src/google/protobuf/text_format.cc', | |
| 994 + 'src/google/protobuf/text_format.h', | |
| 995 + 'src/google/protobuf/timestamp.pb.cc', | |
| 996 + 'src/google/protobuf/timestamp.pb.h', | |
| 997 + 'src/google/protobuf/type.pb.cc', | |
| 998 + 'src/google/protobuf/type.pb.h', | |
| 999 + 'src/google/protobuf/unknown_field_set.cc', | |
| 1000 + 'src/google/protobuf/util/field_comparator.cc', | |
| 1001 + 'src/google/protobuf/util/field_comparator.h', | |
| 1002 + 'src/google/protobuf/util/internal/constants.h', | |
| 1003 + 'src/google/protobuf/util/internal/datapiece.cc', | |
| 1004 + 'src/google/protobuf/util/internal/datapiece.h', | |
| 1005 + 'src/google/protobuf/util/internal/default_value_objectwriter.cc', | |
| 1006 + 'src/google/protobuf/util/internal/default_value_objectwriter.h', | |
| 1007 + 'src/google/protobuf/util/internal/error_listener.cc', | |
| 1008 + 'src/google/protobuf/util/internal/error_listener.h', | |
| 1009 + 'src/google/protobuf/util/internal/field_mask_utility.cc', | |
| 1010 + 'src/google/protobuf/util/internal/field_mask_utility.h', | |
| 1011 + 'src/google/protobuf/util/internal/json_escaping.cc', | |
| 1012 + 'src/google/protobuf/util/internal/json_escaping.h', | |
| 1013 + 'src/google/protobuf/util/internal/json_objectwriter.cc', | |
| 1014 + 'src/google/protobuf/util/internal/json_objectwriter.h', | |
| 1015 + 'src/google/protobuf/util/internal/json_stream_parser.cc', | |
| 1016 + 'src/google/protobuf/util/internal/json_stream_parser.h', | |
| 1017 + 'src/google/protobuf/util/internal/location_tracker.h', | |
| 1018 + 'src/google/protobuf/util/internal/object_location_tracker.h', | |
| 1019 + 'src/google/protobuf/util/internal/object_source.h', | |
| 1020 + 'src/google/protobuf/util/internal/object_writer.cc', | |
| 1021 + 'src/google/protobuf/util/internal/object_writer.h', | |
| 1022 + 'src/google/protobuf/util/internal/protostream_objectsource.cc', | |
| 1023 + 'src/google/protobuf/util/internal/protostream_objectsource.h', | |
| 1024 + 'src/google/protobuf/util/internal/protostream_objectwriter.cc', | |
| 1025 + 'src/google/protobuf/util/internal/protostream_objectwriter.h', | |
| 1026 + 'src/google/protobuf/util/internal/snake2camel_objectwriter.h', | |
| 1027 + 'src/google/protobuf/util/internal/structured_objectwriter.h', | |
| 1028 + 'src/google/protobuf/util/internal/type_info.cc', | |
| 1029 + 'src/google/protobuf/util/internal/type_info.h', | |
| 1030 + 'src/google/protobuf/util/internal/type_info_test_helper.cc', | |
| 1031 + 'src/google/protobuf/util/internal/type_info_test_helper.h', | |
| 1032 + 'src/google/protobuf/util/internal/utility.cc', | |
| 1033 + 'src/google/protobuf/util/internal/utility.h', | |
| 1034 + 'src/google/protobuf/util/json_util.cc', | |
| 1035 + 'src/google/protobuf/util/json_util.h', | |
| 1036 + 'src/google/protobuf/util/message_differencer.cc', | |
| 1037 + 'src/google/protobuf/util/message_differencer.h', | |
| 1038 + 'src/google/protobuf/util/type_resolver.h', | |
| 1039 + 'src/google/protobuf/util/type_resolver_util.cc', | |
| 1040 + 'src/google/protobuf/util/type_resolver_util.h', | |
| 1041 + 'src/google/protobuf/wire_format.cc', | |
| 1042 + 'src/google/protobuf/wire_format.h', | |
| 1043 + 'src/google/protobuf/wrappers.pb.cc', | |
| 1044 + 'src/google/protobuf/wrappers.pb.h', | |
| 1045 + ], | |
| 1046 + 'dependencies': [ | |
| 1047 + 'protobuf_lite', | |
| 1048 + ], | |
| 1049 + 'export_dependent_settings': [ | |
| 1050 + 'protobuf_lite', | |
| 1051 + ], | |
| 1052 + }, | |
| 1053 + { | |
| 1054 + 'target_name': 'protoc', | |
| 1055 + 'conditions': [ | |
| 1056 + ['OS!="ios" or "<(GENERATOR)"!="xcode" or "<(GENERATOR_FLAVOR)"=="n
inja"', { | |
| 1057 + 'type': 'executable', | |
| 1058 + 'toolsets': ['host'], | |
| 1059 + 'sources': [ | |
| 1060 + 'src/google/protobuf/compiler/code_generator.cc', | |
| 1061 + 'src/google/protobuf/compiler/code_generator.h', | |
| 1062 + 'src/google/protobuf/compiler/command_line_interface.cc', | |
| 1063 + 'src/google/protobuf/compiler/command_line_interface.h', | |
| 1064 + 'src/google/protobuf/compiler/cpp/cpp_enum.cc', | |
| 1065 + 'src/google/protobuf/compiler/cpp/cpp_enum.h', | |
| 1066 + 'src/google/protobuf/compiler/cpp/cpp_enum_field.cc', | |
| 1067 + 'src/google/protobuf/compiler/cpp/cpp_enum_field.h', | |
| 1068 + 'src/google/protobuf/compiler/cpp/cpp_extension.cc', | |
| 1069 + 'src/google/protobuf/compiler/cpp/cpp_extension.h', | |
| 1070 + 'src/google/protobuf/compiler/cpp/cpp_field.cc', | |
| 1071 + 'src/google/protobuf/compiler/cpp/cpp_field.h', | |
| 1072 + 'src/google/protobuf/compiler/cpp/cpp_file.cc', | |
| 1073 + 'src/google/protobuf/compiler/cpp/cpp_file.h', | |
| 1074 + 'src/google/protobuf/compiler/cpp/cpp_generator.cc', | |
| 1075 + 'src/google/protobuf/compiler/cpp/cpp_generator.h', | |
| 1076 + 'src/google/protobuf/compiler/cpp/cpp_helpers.cc', | |
| 1077 + 'src/google/protobuf/compiler/cpp/cpp_helpers.h', | |
| 1078 + 'src/google/protobuf/compiler/cpp/cpp_map_field.cc', | |
| 1079 + 'src/google/protobuf/compiler/cpp/cpp_map_field.h', | |
| 1080 + 'src/google/protobuf/compiler/cpp/cpp_message.cc', | |
| 1081 + 'src/google/protobuf/compiler/cpp/cpp_message.h', | |
| 1082 + 'src/google/protobuf/compiler/cpp/cpp_message_field.cc', | |
| 1083 + 'src/google/protobuf/compiler/cpp/cpp_message_field.h', | |
| 1084 + 'src/google/protobuf/compiler/cpp/cpp_options.h', | |
| 1085 + 'src/google/protobuf/compiler/cpp/cpp_primitive_field.cc', | |
| 1086 + 'src/google/protobuf/compiler/cpp/cpp_primitive_field.h', | |
| 1087 + 'src/google/protobuf/compiler/cpp/cpp_service.cc', | |
| 1088 + 'src/google/protobuf/compiler/cpp/cpp_service.h', | |
| 1089 + 'src/google/protobuf/compiler/cpp/cpp_string_field.cc', | |
| 1090 + 'src/google/protobuf/compiler/cpp/cpp_string_field.h', | |
| 1091 + 'src/google/protobuf/compiler/csharp/csharp_enum.cc', | |
| 1092 + 'src/google/protobuf/compiler/csharp/csharp_enum.h', | |
| 1093 + 'src/google/protobuf/compiler/csharp/csharp_enum_field.cc', | |
| 1094 + 'src/google/protobuf/compiler/csharp/csharp_enum_field.h', | |
| 1095 + 'src/google/protobuf/compiler/csharp/csharp_field_base.cc', | |
| 1096 + 'src/google/protobuf/compiler/csharp/csharp_field_base.h', | |
| 1097 + 'src/google/protobuf/compiler/csharp/csharp_generator.cc', | |
| 1098 + 'src/google/protobuf/compiler/csharp/csharp_generator.h', | |
| 1099 + 'src/google/protobuf/compiler/csharp/csharp_helpers.cc', | |
| 1100 + 'src/google/protobuf/compiler/csharp/csharp_helpers.h', | |
| 1101 + 'src/google/protobuf/compiler/csharp/csharp_map_field.cc', | |
| 1102 + 'src/google/protobuf/compiler/csharp/csharp_map_field.h', | |
| 1103 + 'src/google/protobuf/compiler/csharp/csharp_message.cc', | |
| 1104 + 'src/google/protobuf/compiler/csharp/csharp_message.h', | |
| 1105 + 'src/google/protobuf/compiler/csharp/csharp_message_field.cc', | |
| 1106 + 'src/google/protobuf/compiler/csharp/csharp_message_field.h', | |
| 1107 + 'src/google/protobuf/compiler/csharp/csharp_names.h', | |
| 1108 + 'src/google/protobuf/compiler/csharp/csharp_primitive_field.cc'
, | |
| 1109 + 'src/google/protobuf/compiler/csharp/csharp_primitive_field.h', | |
| 1110 + 'src/google/protobuf/compiler/csharp/csharp_repeated_enum_field
.cc', | |
| 1111 + 'src/google/protobuf/compiler/csharp/csharp_repeated_enum_field
.h', | |
| 1112 + 'src/google/protobuf/compiler/csharp/csharp_repeated_message_fi
eld.cc', | |
| 1113 + 'src/google/protobuf/compiler/csharp/csharp_repeated_message_fi
eld.h', | |
| 1114 + 'src/google/protobuf/compiler/csharp/csharp_repeated_primitive_
field.cc', | |
| 1115 + 'src/google/protobuf/compiler/csharp/csharp_repeated_primitive_
field.h', | |
| 1116 + 'src/google/protobuf/compiler/csharp/csharp_source_generator_ba
se.cc', | |
| 1117 + 'src/google/protobuf/compiler/csharp/csharp_source_generator_ba
se.h', | |
| 1118 + 'src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc', | |
| 1119 + 'src/google/protobuf/compiler/csharp/csharp_umbrella_class.h', | |
| 1120 + 'src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc', | |
| 1121 + 'src/google/protobuf/compiler/csharp/csharp_wrapper_field.h', | |
| 1122 + 'src/google/protobuf/compiler/java/java_context.cc', | |
| 1123 + 'src/google/protobuf/compiler/java/java_context.h', | |
| 1124 + 'src/google/protobuf/compiler/java/java_doc_comment.cc', | |
| 1125 + 'src/google/protobuf/compiler/java/java_doc_comment.h', | |
| 1126 + 'src/google/protobuf/compiler/java/java_enum.cc', | |
| 1127 + 'src/google/protobuf/compiler/java/java_enum.h', | |
| 1128 + 'src/google/protobuf/compiler/java/java_enum_field.cc', | |
| 1129 + 'src/google/protobuf/compiler/java/java_enum_field.h', | |
| 1130 + 'src/google/protobuf/compiler/java/java_enum_field_lite.cc', | |
| 1131 + 'src/google/protobuf/compiler/java/java_enum_field_lite.h', | |
| 1132 + 'src/google/protobuf/compiler/java/java_extension.cc', | |
| 1133 + 'src/google/protobuf/compiler/java/java_extension.h', | |
| 1134 + 'src/google/protobuf/compiler/java/java_field.cc', | |
| 1135 + 'src/google/protobuf/compiler/java/java_field.h', | |
| 1136 + 'src/google/protobuf/compiler/java/java_file.cc', | |
| 1137 + 'src/google/protobuf/compiler/java/java_file.h', | |
| 1138 + 'src/google/protobuf/compiler/java/java_generator.cc', | |
| 1139 + 'src/google/protobuf/compiler/java/java_generator.h', | |
| 1140 + 'src/google/protobuf/compiler/java/java_generator_factory.cc', | |
| 1141 + 'src/google/protobuf/compiler/java/java_generator_factory.h', | |
| 1142 + 'src/google/protobuf/compiler/java/java_helpers.cc', | |
| 1143 + 'src/google/protobuf/compiler/java/java_helpers.h', | |
| 1144 + 'src/google/protobuf/compiler/java/java_lazy_message_field.cc', | |
| 1145 + 'src/google/protobuf/compiler/java/java_lazy_message_field.h', | |
| 1146 + 'src/google/protobuf/compiler/java/java_lazy_message_field_lite
.cc', | |
| 1147 + 'src/google/protobuf/compiler/java/java_lazy_message_field_lite
.h', | |
| 1148 + 'src/google/protobuf/compiler/java/java_map_field.cc', | |
| 1149 + 'src/google/protobuf/compiler/java/java_map_field.h', | |
| 1150 + 'src/google/protobuf/compiler/java/java_map_field_lite.cc', | |
| 1151 + 'src/google/protobuf/compiler/java/java_map_field_lite.h', | |
| 1152 + 'src/google/protobuf/compiler/java/java_message.cc', | |
| 1153 + 'src/google/protobuf/compiler/java/java_message.h', | |
| 1154 + 'src/google/protobuf/compiler/java/java_message_builder.cc', | |
| 1155 + 'src/google/protobuf/compiler/java/java_message_builder.h', | |
| 1156 + 'src/google/protobuf/compiler/java/java_message_builder_lite.cc
', | |
| 1157 + 'src/google/protobuf/compiler/java/java_message_builder_lite.h'
, | |
| 1158 + 'src/google/protobuf/compiler/java/java_message_field.cc', | |
| 1159 + 'src/google/protobuf/compiler/java/java_message_field.h', | |
| 1160 + 'src/google/protobuf/compiler/java/java_message_field_lite.cc', | |
| 1161 + 'src/google/protobuf/compiler/java/java_message_field_lite.h', | |
| 1162 + 'src/google/protobuf/compiler/java/java_message_lite.cc', | |
| 1163 + 'src/google/protobuf/compiler/java/java_message_lite.h', | |
| 1164 + 'src/google/protobuf/compiler/java/java_name_resolver.cc', | |
| 1165 + 'src/google/protobuf/compiler/java/java_name_resolver.h', | |
| 1166 + 'src/google/protobuf/compiler/java/java_primitive_field.cc', | |
| 1167 + 'src/google/protobuf/compiler/java/java_primitive_field.h', | |
| 1168 + 'src/google/protobuf/compiler/java/java_primitive_field_lite.cc
', | |
| 1169 + 'src/google/protobuf/compiler/java/java_primitive_field_lite.h'
, | |
| 1170 + 'src/google/protobuf/compiler/java/java_service.cc', | |
| 1171 + 'src/google/protobuf/compiler/java/java_service.h', | |
| 1172 + 'src/google/protobuf/compiler/java/java_shared_code_generator.c
c', | |
| 1173 + 'src/google/protobuf/compiler/java/java_shared_code_generator.h
', | |
| 1174 + 'src/google/protobuf/compiler/java/java_string_field.cc', | |
| 1175 + 'src/google/protobuf/compiler/java/java_string_field.h', | |
| 1176 + 'src/google/protobuf/compiler/java/java_string_field_lite.cc', | |
| 1177 + 'src/google/protobuf/compiler/java/java_string_field_lite.h', | |
| 1178 + 'src/google/protobuf/compiler/javanano/javanano_enum.cc', | |
| 1179 + 'src/google/protobuf/compiler/javanano/javanano_enum.h', | |
| 1180 + 'src/google/protobuf/compiler/javanano/javanano_enum_field.cc', | |
| 1181 + 'src/google/protobuf/compiler/javanano/javanano_enum_field.h', | |
| 1182 + 'src/google/protobuf/compiler/javanano/javanano_extension.cc', | |
| 1183 + 'src/google/protobuf/compiler/javanano/javanano_extension.h', | |
| 1184 + 'src/google/protobuf/compiler/javanano/javanano_field.cc', | |
| 1185 + 'src/google/protobuf/compiler/javanano/javanano_field.h', | |
| 1186 + 'src/google/protobuf/compiler/javanano/javanano_file.cc', | |
| 1187 + 'src/google/protobuf/compiler/javanano/javanano_file.h', | |
| 1188 + 'src/google/protobuf/compiler/javanano/javanano_generator.cc', | |
| 1189 + 'src/google/protobuf/compiler/javanano/javanano_generator.h', | |
| 1190 + 'src/google/protobuf/compiler/javanano/javanano_helpers.cc', | |
| 1191 + 'src/google/protobuf/compiler/javanano/javanano_helpers.h', | |
| 1192 + 'src/google/protobuf/compiler/javanano/javanano_map_field.cc', | |
| 1193 + 'src/google/protobuf/compiler/javanano/javanano_map_field.h', | |
| 1194 + 'src/google/protobuf/compiler/javanano/javanano_message.cc', | |
| 1195 + 'src/google/protobuf/compiler/javanano/javanano_message.h', | |
| 1196 + 'src/google/protobuf/compiler/javanano/javanano_message_field.c
c', | |
| 1197 + 'src/google/protobuf/compiler/javanano/javanano_message_field.h
', | |
| 1198 + 'src/google/protobuf/compiler/javanano/javanano_params.h', | |
| 1199 + 'src/google/protobuf/compiler/javanano/javanano_primitive_field
.cc', | |
| 1200 + 'src/google/protobuf/compiler/javanano/javanano_primitive_field
.h', | |
| 1201 + 'src/google/protobuf/compiler/main.cc', | |
| 1202 + 'src/google/protobuf/compiler/objectivec/objectivec_enum.cc', | |
| 1203 + 'src/google/protobuf/compiler/objectivec/objectivec_enum.h', | |
| 1204 + 'src/google/protobuf/compiler/objectivec/objectivec_enum_field.
cc', | |
| 1205 + 'src/google/protobuf/compiler/objectivec/objectivec_enum_field.
h', | |
| 1206 + 'src/google/protobuf/compiler/objectivec/objectivec_extension.c
c', | |
| 1207 + 'src/google/protobuf/compiler/objectivec/objectivec_extension.h
', | |
| 1208 + 'src/google/protobuf/compiler/objectivec/objectivec_field.cc', | |
| 1209 + 'src/google/protobuf/compiler/objectivec/objectivec_field.h', | |
| 1210 + 'src/google/protobuf/compiler/objectivec/objectivec_file.cc', | |
| 1211 + 'src/google/protobuf/compiler/objectivec/objectivec_file.h', | |
| 1212 + 'src/google/protobuf/compiler/objectivec/objectivec_generator.c
c', | |
| 1213 + 'src/google/protobuf/compiler/objectivec/objectivec_generator.h
', | |
| 1214 + 'src/google/protobuf/compiler/objectivec/objectivec_helpers.cc'
, | |
| 1215 + 'src/google/protobuf/compiler/objectivec/objectivec_helpers.h', | |
| 1216 + 'src/google/protobuf/compiler/objectivec/objectivec_map_field.c
c', | |
| 1217 + 'src/google/protobuf/compiler/objectivec/objectivec_map_field.h
', | |
| 1218 + 'src/google/protobuf/compiler/objectivec/objectivec_message.cc'
, | |
| 1219 + 'src/google/protobuf/compiler/objectivec/objectivec_message.h', | |
| 1220 + 'src/google/protobuf/compiler/objectivec/objectivec_message_fie
ld.cc', | |
| 1221 + 'src/google/protobuf/compiler/objectivec/objectivec_message_fie
ld.h', | |
| 1222 + 'src/google/protobuf/compiler/objectivec/objectivec_oneof.cc', | |
| 1223 + 'src/google/protobuf/compiler/objectivec/objectivec_oneof.h', | |
| 1224 + 'src/google/protobuf/compiler/objectivec/objectivec_primitive_f
ield.cc', | |
| 1225 + 'src/google/protobuf/compiler/objectivec/objectivec_primitive_f
ield.h', | |
| 1226 + 'src/google/protobuf/compiler/plugin.cc', | |
| 1227 + 'src/google/protobuf/compiler/plugin.h', | |
| 1228 + 'src/google/protobuf/compiler/plugin.pb.cc', | |
| 1229 + 'src/google/protobuf/compiler/plugin.pb.h', | |
| 1230 + 'src/google/protobuf/compiler/python/python_generator.cc', | |
| 1231 + 'src/google/protobuf/compiler/python/python_generator.h', | |
| 1232 + 'src/google/protobuf/compiler/ruby/ruby_generator.cc', | |
| 1233 + 'src/google/protobuf/compiler/ruby/ruby_generator.h', | |
| 1234 + 'src/google/protobuf/compiler/subprocess.cc', | |
| 1235 + 'src/google/protobuf/compiler/subprocess.h', | |
| 1236 + 'src/google/protobuf/compiler/zip_writer.cc', | |
| 1237 + 'src/google/protobuf/compiler/zip_writer.h', | |
| 1238 + ], | |
| 1239 + 'dependencies': [ | |
| 1240 + 'protobuf_full_do_not_use', | |
| 1241 + ], | |
| 1242 + }, { # else, OS=="ios" and "<(GENERATOR)"=="xcode" and "<(GENERATO
R_FLAVOR)"!="ninja" | |
| 1243 + 'type': 'none', | |
| 1244 + 'toolsets': ['host'], | |
| 1245 + 'dependencies': [ | |
| 1246 + 'compile_protoc', | |
| 1247 + ], | |
| 1248 + 'actions': [ | |
| 1249 + { | |
| 1250 + 'action_name': 'copy protoc', | |
| 1251 + 'inputs': [ | |
| 1252 + '<(ninja_product_dir)/protoc', | |
| 1253 + ], | |
| 1254 + 'outputs': [ | |
| 1255 + '<(PRODUCT_DIR)/protoc', | |
| 1256 + ], | |
| 1257 + 'action': [ | |
| 1258 + 'cp', | |
| 1259 + '<(ninja_product_dir)/protoc', | |
| 1260 + '<(PRODUCT_DIR)/protoc', | |
| 1261 + ], | |
| 1262 + }, | |
| 1263 + ], | |
| 1264 + }], | |
| 1265 + ], | |
| 1266 + }, | |
| 1267 + { | |
| 1268 + # Generate the python module needed by all protoc-generated Python co
de. | |
| 1269 + 'target_name': 'py_proto', | |
| 1270 + 'type': 'none', | |
| 1271 + 'copies': [ | |
| 1272 + { | |
| 1273 + 'destination': '<(PRODUCT_DIR)/pyproto/google/', | |
| 1274 + 'files': [ | |
| 1275 + 'python/google/__init__.py', | |
| 1276 + ], | |
| 1277 + }, | |
| 1278 + { | |
| 1279 + 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf', | |
| 1280 + 'files': [ | |
| 1281 + 'python/google/protobuf/__init__.py', | |
| 1282 + 'python/google/protobuf/descriptor.py', | |
| 1283 + 'python/google/protobuf/descriptor_database.py', | |
| 1284 + # TODO(ncarter): protoc's python generator treats | |
| 1285 + # descriptor.proto specially, but only when the input path is | |
| 1286 + # exactly "google/protobuf/descriptor.proto". I'm not sure how | |
| 1287 + # to execute a rule from a different directory. For now, use a | |
| 1288 + # manually-generated copy of descriptor_pb2.py. | |
| 1289 + 'python/google/protobuf/descriptor_pb2.py', | |
| 1290 + 'python/google/protobuf/descriptor_pool.py', | |
| 1291 + 'python/google/protobuf/message.py', | |
| 1292 + 'python/google/protobuf/message_factory.py', | |
| 1293 + 'python/google/protobuf/proto_builder.py', | |
| 1294 + 'python/google/protobuf/reflection.py', | |
| 1295 + 'python/google/protobuf/service.py', | |
| 1296 + 'python/google/protobuf/service_reflection.py', | |
| 1297 + 'python/google/protobuf/symbol_database.py', | |
| 1298 + 'python/google/protobuf/text_encoding.py', | |
| 1299 + 'python/google/protobuf/text_format.py', | |
| 1300 + ], | |
| 1301 + }, | |
| 1302 + { | |
| 1303 + 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf/internal', | |
| 1304 + 'files': [ | |
| 1305 + 'python/google/protobuf/internal/__init__.py', | |
| 1306 + 'python/google/protobuf/internal/api_implementation.py', | |
| 1307 + 'python/google/protobuf/internal/containers.py', | |
| 1308 + 'python/google/protobuf/internal/decoder.py', | |
| 1309 + 'python/google/protobuf/internal/encoder.py', | |
| 1310 + 'python/google/protobuf/internal/enum_type_wrapper.py', | |
| 1311 + 'python/google/protobuf/internal/generator_test.py', | |
| 1312 + 'python/google/protobuf/internal/message_listener.py', | |
| 1313 + 'python/google/protobuf/internal/python_message.py', | |
| 1314 + 'python/google/protobuf/internal/type_checkers.py', | |
| 1315 + 'python/google/protobuf/internal/wire_format.py', | |
| 1316 + ], | |
| 1317 + }, | |
| 1318 + { | |
| 1319 + 'destination': '<(PRODUCT_DIR)/pyproto/google/protobuf/pyext', | |
| 1320 + 'files': [ | |
| 1321 + 'python/google/protobuf/pyext/__init__.py', | |
| 1322 + 'python/google/protobuf/pyext/cpp_message.py', | |
| 1323 + ], | |
| 1324 + }, | |
| 1325 + ], | |
| 1326 + }, | |
| 1327 + ], | |
| 1328 + }, { # use_system_protobuf==1 | |
| 1329 + 'targets': [ | |
| 1330 + { | |
| 1331 + 'target_name': 'protobuf_lite', | |
| 1332 + 'type': 'none', | |
| 1333 + 'direct_dependent_settings': { | |
| 1334 + 'cflags': [ | |
| 1335 + # Use full protobuf, because vanilla protobuf doesn't have | |
| 1336 + # our custom patch to retain unknown fields in lite mode. | |
| 1337 + '<!@(pkg-config --cflags protobuf)', | |
| 1338 + ], | |
| 1339 + 'defines': [ | |
| 1340 + 'USE_SYSTEM_PROTOBUF', | |
| 1341 + | |
| 1342 + # This macro must be defined to suppress the use | |
| 1343 + # of dynamic_cast<>, which requires RTTI. | |
| 1344 + 'GOOGLE_PROTOBUF_NO_RTTI', | |
| 1345 + 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER', | |
| 1346 + ], | |
| 1347 + }, | |
| 1348 + 'link_settings': { | |
| 1349 + # Use full protobuf, because vanilla protobuf doesn't have | |
| 1350 + # our custom patch to retain unknown fields in lite mode. | |
| 1351 + 'ldflags': [ | |
| 1352 + '<!@(pkg-config --libs-only-L --libs-only-other protobuf)', | |
| 1353 + ], | |
| 1354 + 'libraries': [ | |
| 1355 + '<!@(pkg-config --libs-only-l protobuf)', | |
| 1356 + ], | |
| 1357 + }, | |
| 1358 + }, | |
| 1359 + { | |
| 1360 + 'target_name': 'protoc', | |
| 1361 + 'type': 'none', | |
| 1362 + 'toolsets': ['host', 'target'], | |
| 1363 + }, | |
| 1364 + { | |
| 1365 + 'target_name': 'py_proto', | |
| 1366 + 'type': 'none', | |
| 1367 + }, | |
| 1368 + ], | |
| 1369 + }], | |
| 1370 + ], | |
| 1371 +} | |
| 1372 diff --git a/third_party/protobuf/protobuf_lite.gypi b/third_party/protobuf/prot
obuf_lite.gypi | |
| 1373 new file mode 100644 | |
| 1374 index 0000000..90fe65b | |
| 1375 --- /dev/null | |
| 1376 +++ b/third_party/protobuf/protobuf_lite.gypi | |
| 1377 @@ -0,0 +1,109 @@ | |
| 1378 +# Copyright 2013 The Chromium Authors. All rights reserved. | |
| 1379 +# Use of this source code is governed by a BSD-style license that can be | |
| 1380 +# found in the LICENSE file. | |
| 1381 + | |
| 1382 +{ | |
| 1383 + 'sources': [ | |
| 1384 + 'src/google/protobuf/arena.cc', | |
| 1385 + 'src/google/protobuf/arena.h', | |
| 1386 + 'src/google/protobuf/arenastring.cc', | |
| 1387 + 'src/google/protobuf/arenastring.h', | |
| 1388 + 'src/google/protobuf/descriptor.h', | |
| 1389 + 'src/google/protobuf/descriptor.pb.h', | |
| 1390 + 'src/google/protobuf/extension_set.cc', | |
| 1391 + 'src/google/protobuf/extension_set.h', | |
| 1392 + 'src/google/protobuf/generated_enum_reflection.h', | |
| 1393 + 'src/google/protobuf/generated_enum_util.h', | |
| 1394 + 'src/google/protobuf/generated_message_util.cc', | |
| 1395 + 'src/google/protobuf/generated_message_util.h', | |
| 1396 + 'src/google/protobuf/io/coded_stream.cc', | |
| 1397 + 'src/google/protobuf/io/coded_stream.h', | |
| 1398 + 'src/google/protobuf/io/coded_stream_inl.h', | |
| 1399 + 'src/google/protobuf/io/zero_copy_stream.cc', | |
| 1400 + 'src/google/protobuf/io/zero_copy_stream.h', | |
| 1401 + 'src/google/protobuf/io/zero_copy_stream_impl_lite.cc', | |
| 1402 + 'src/google/protobuf/io/zero_copy_stream_impl_lite.h', | |
| 1403 + 'src/google/protobuf/message.h', | |
| 1404 + 'src/google/protobuf/message_lite.cc', | |
| 1405 + 'src/google/protobuf/message_lite.h', | |
| 1406 + 'src/google/protobuf/metadata.h', | |
| 1407 + 'src/google/protobuf/repeated_field.cc', | |
| 1408 + 'src/google/protobuf/repeated_field.h', | |
| 1409 + 'src/google/protobuf/stubs/atomic_sequence_num.h', | |
| 1410 + 'src/google/protobuf/stubs/atomicops.h', | |
| 1411 + 'src/google/protobuf/stubs/atomicops_internals_aix.h', | |
| 1412 + 'src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h', | |
| 1413 + 'src/google/protobuf/stubs/atomicops_internals_arm_gcc.h', | |
| 1414 + 'src/google/protobuf/stubs/atomicops_internals_arm_qnx.h', | |
| 1415 + 'src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h', | |
| 1416 + 'src/google/protobuf/stubs/atomicops_internals_generic_gcc.h', | |
| 1417 + 'src/google/protobuf/stubs/atomicops_internals_macosx.h', | |
| 1418 + 'src/google/protobuf/stubs/atomicops_internals_mips_gcc.h', | |
| 1419 + 'src/google/protobuf/stubs/atomicops_internals_pnacl.h', | |
| 1420 + 'src/google/protobuf/stubs/atomicops_internals_solaris.h', | |
| 1421 + 'src/google/protobuf/stubs/atomicops_internals_tsan.h', | |
| 1422 + 'src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc', | |
| 1423 + 'src/google/protobuf/stubs/atomicops_internals_x86_gcc.h', | |
| 1424 + 'src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc', | |
| 1425 + 'src/google/protobuf/stubs/atomicops_internals_x86_msvc.h', | |
| 1426 + 'src/google/protobuf/stubs/bytestream.cc', | |
| 1427 + 'src/google/protobuf/stubs/bytestream.h', | |
| 1428 + 'src/google/protobuf/stubs/callback.h', | |
| 1429 + 'src/google/protobuf/stubs/casts.h', | |
| 1430 + 'src/google/protobuf/stubs/common.cc', | |
| 1431 + 'src/google/protobuf/stubs/common.h', | |
| 1432 + 'src/google/protobuf/stubs/fastmem.h', | |
| 1433 + 'src/google/protobuf/stubs/hash.h', | |
| 1434 + 'src/google/protobuf/stubs/logging.h', | |
| 1435 + 'src/google/protobuf/stubs/macros.h', | |
| 1436 + 'src/google/protobuf/stubs/map_util.h', | |
| 1437 + 'src/google/protobuf/stubs/mathlimits.h', | |
| 1438 + 'src/google/protobuf/stubs/mutex.h', | |
| 1439 + 'src/google/protobuf/stubs/once.cc', | |
| 1440 + 'src/google/protobuf/stubs/once.h', | |
| 1441 + 'src/google/protobuf/stubs/platform_macros.h', | |
| 1442 + 'src/google/protobuf/stubs/port.h', | |
| 1443 + 'src/google/protobuf/stubs/scoped_ptr.h', | |
| 1444 + 'src/google/protobuf/stubs/status.cc', | |
| 1445 + 'src/google/protobuf/stubs/status.h', | |
| 1446 + 'src/google/protobuf/stubs/statusor.cc', | |
| 1447 + 'src/google/protobuf/stubs/statusor.h', | |
| 1448 + 'src/google/protobuf/stubs/stl_util.h', | |
| 1449 + 'src/google/protobuf/stubs/stringpiece.cc', | |
| 1450 + 'src/google/protobuf/stubs/stringpiece.h', | |
| 1451 + 'src/google/protobuf/stubs/stringprintf.cc', | |
| 1452 + 'src/google/protobuf/stubs/stringprintf.h', | |
| 1453 + 'src/google/protobuf/stubs/strutil.cc', | |
| 1454 + 'src/google/protobuf/stubs/strutil.h', | |
| 1455 + 'src/google/protobuf/stubs/template_util.h', | |
| 1456 + 'src/google/protobuf/stubs/time.cc', | |
| 1457 + 'src/google/protobuf/stubs/time.h', | |
| 1458 + 'src/google/protobuf/stubs/type_traits.h', | |
| 1459 + 'src/google/protobuf/testing/googletest.h', | |
| 1460 + 'src/google/protobuf/unknown_field_set.h', | |
| 1461 + 'src/google/protobuf/wire_format_lite.cc', | |
| 1462 + 'src/google/protobuf/wire_format_lite.h', | |
| 1463 + 'src/google/protobuf/wire_format_lite_inl.h', | |
| 1464 + ], | |
| 1465 + 'include_dirs': [ | |
| 1466 + 'src', | |
| 1467 + ], | |
| 1468 + # This macro must be defined to suppress the use of dynamic_cast<>, | |
| 1469 + # which requires RTTI. | |
| 1470 + 'defines': [ | |
| 1471 + 'GOOGLE_PROTOBUF_NO_RTTI', | |
| 1472 + 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER', | |
| 1473 + 'HAVE_PTHREAD', | |
| 1474 + ], | |
| 1475 + 'direct_dependent_settings': { | |
| 1476 + 'include_dirs': [ | |
| 1477 + 'src', | |
| 1478 + ], | |
| 1479 + 'defines': [ | |
| 1480 + 'GOOGLE_PROTOBUF_NO_RTTI', | |
| 1481 + 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER', | |
| 1482 + ], | |
| 1483 + # TODO(jschuh): http://crbug.com/167187 size_t -> int. | |
| 1484 + 'msvs_disabled_warnings': [ 4267 ], | |
| 1485 + }, | |
| 1486 +} | |
| 1487 diff --git a/third_party/protobuf/protobuf_nacl.gyp b/third_party/protobuf/proto
buf_nacl.gyp | |
| 1488 new file mode 100644 | |
| 1489 index 0000000..4b63e5c | |
| 1490 --- /dev/null | |
| 1491 +++ b/third_party/protobuf/protobuf_nacl.gyp | |
| 1492 @@ -0,0 +1,25 @@ | |
| 1493 +# Copyright 2014 The Chromium Authors. All rights reserved. | |
| 1494 +# Use of this source code is governed by a BSD-style license that can be | |
| 1495 +# found in the LICENSE file. | |
| 1496 + | |
| 1497 +{ | |
| 1498 + 'includes': [ | |
| 1499 + '../../native_client/build/untrusted.gypi', | |
| 1500 + ], | |
| 1501 + 'targets': [ | |
| 1502 + { | |
| 1503 + 'target_name': 'protobuf_lite_nacl', | |
| 1504 + 'type': 'none', | |
| 1505 + 'variables': { | |
| 1506 + 'nacl_untrusted_build': 1, | |
| 1507 + 'nlib_target': 'libprotobuf_lite_nacl.a', | |
| 1508 + 'build_glibc': 0, | |
| 1509 + 'build_newlib': 0, | |
| 1510 + 'build_pnacl_newlib': 1, | |
| 1511 + }, | |
| 1512 + 'includes': [ | |
| 1513 + 'protobuf_lite.gypi', | |
| 1514 + ], | |
| 1515 + }, | |
| 1516 + ] | |
| 1517 +} | |
| OLD | NEW |