Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 if (is_win) { | |
| 6 config_h_dir = "vsprojects" | |
| 7 } else { | |
| 8 config_h_dir = "." | |
| 9 } | |
| 10 | |
| 11 config("protobuf_config") { | 5 config("protobuf_config") { |
| 12 include_dirs = [ | 6 include_dirs = [ "src" ] |
| 13 "src", | |
| 14 config_h_dir, | |
| 15 ] | |
| 16 defines = [ | 7 defines = [ |
| 17 "GOOGLE_PROTOBUF_NO_RTTI", | 8 "GOOGLE_PROTOBUF_NO_RTTI", |
| 18 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", | 9 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", |
| 19 ] | 10 ] |
| 11 if (!is_win) { | |
| 12 defines += [ "HAVE_PTHREAD" ] | |
| 13 } | |
| 14 } | |
| 15 | |
| 16 config("protobuf_warnings") { | |
| 17 cflags = [] | |
| 18 if (is_clang) { | |
| 19 # protobuf-3 contains a few functions that are unused. | |
| 20 cflags += [ "-Wno-unused-function" ] | |
| 21 } | |
| 20 } | 22 } |
| 21 | 23 |
| 22 if (is_component_build) { | 24 if (is_component_build) { |
| 23 config("protobuf_use_dlls") { | 25 config("protobuf_use_dlls") { |
| 24 defines = [ "PROTOBUF_USE_DLLS" ] | 26 defines = [ "PROTOBUF_USE_DLLS" ] |
| 25 } | 27 } |
| 26 } | 28 } |
| 27 | 29 |
| 28 # This config should be applied to targets using generated code from the proto | 30 # This config should be applied to targets using generated code from the proto |
| 29 # compiler. It sets up the include directories properly. | 31 # compiler. It sets up the include directories properly. |
| 30 config("using_proto") { | 32 config("using_proto") { |
| 31 include_dirs = [ | 33 include_dirs = [ |
| 32 "src", | 34 "src", |
| 33 "$root_gen_dir/protoc_out", | 35 "$root_gen_dir/protoc_out", |
| 34 ] | 36 ] |
| 35 } | 37 } |
| 36 | 38 |
| 37 protobuf_lite_sources = [ | 39 protobuf_lite_sources = [ |
|
Peter Kasting
2016/04/13 02:11:44
Files my earlier patch set lists here that yours d
xyzzyz
2016/04/14 00:23:57
Most of the files you mention are part of protobuf
xyzzyz
2016/04/14 23:57:54
In another pass I removed testing/googletest.{cc,h
Peter Kasting
2016/04/15 01:12:59
Right -- my concern was not that they were entirel
| |
| 40 "src/google/protobuf/arena.cc", | |
| 41 "src/google/protobuf/arena.h", | |
| 42 "src/google/protobuf/arenastring.cc", | |
| 43 "src/google/protobuf/arenastring.h", | |
| 38 "src/google/protobuf/extension_set.cc", | 44 "src/google/protobuf/extension_set.cc", |
| 39 "src/google/protobuf/extension_set.h", | 45 "src/google/protobuf/extension_set.h", |
| 40 "src/google/protobuf/generated_message_util.cc", | 46 "src/google/protobuf/generated_message_util.cc", |
| 41 "src/google/protobuf/generated_message_util.h", | 47 "src/google/protobuf/generated_message_util.h", |
| 42 "src/google/protobuf/io/coded_stream.cc", | 48 "src/google/protobuf/io/coded_stream.cc", |
| 43 "src/google/protobuf/io/coded_stream.h", | 49 "src/google/protobuf/io/coded_stream.h", |
| 44 "src/google/protobuf/io/coded_stream_inl.h", | |
| 45 "src/google/protobuf/io/zero_copy_stream.cc", | 50 "src/google/protobuf/io/zero_copy_stream.cc", |
| 46 "src/google/protobuf/io/zero_copy_stream.h", | 51 "src/google/protobuf/io/zero_copy_stream.h", |
| 47 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", | 52 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", |
| 48 "src/google/protobuf/io/zero_copy_stream_impl_lite.h", | 53 "src/google/protobuf/io/zero_copy_stream_impl_lite.h", |
| 54 "src/google/protobuf/map.h", | |
| 55 "src/google/protobuf/map_entry_lite.h", | |
| 56 "src/google/protobuf/map_field_lite.h", | |
| 57 "src/google/protobuf/map_type_handler.h", | |
| 49 "src/google/protobuf/message_lite.cc", | 58 "src/google/protobuf/message_lite.cc", |
| 50 "src/google/protobuf/message_lite.h", | 59 "src/google/protobuf/message_lite.h", |
| 51 "src/google/protobuf/repeated_field.cc", | 60 "src/google/protobuf/repeated_field.cc", |
| 52 "src/google/protobuf/repeated_field.h", | 61 "src/google/protobuf/repeated_field.h", |
| 53 "src/google/protobuf/stubs/atomicops.h", | 62 "src/google/protobuf/stubs/atomicops.h", |
| 63 "src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h", | |
| 54 "src/google/protobuf/stubs/atomicops_internals_arm_gcc.h", | 64 "src/google/protobuf/stubs/atomicops_internals_arm_gcc.h", |
| 65 "src/google/protobuf/stubs/atomicops_internals_arm_qnx.h", | |
| 55 "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h", | 66 "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h", |
| 67 "src/google/protobuf/stubs/atomicops_internals_generic_gcc.h", | |
| 56 "src/google/protobuf/stubs/atomicops_internals_macosx.h", | 68 "src/google/protobuf/stubs/atomicops_internals_macosx.h", |
| 57 "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h", | 69 "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h", |
| 70 "src/google/protobuf/stubs/atomicops_internals_pnacl.h", | |
| 71 "src/google/protobuf/stubs/atomicops_internals_power.h", | |
| 72 "src/google/protobuf/stubs/atomicops_internals_solaris.h", | |
| 73 "src/google/protobuf/stubs/atomicops_internals_tsan.h", | |
| 58 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", | 74 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", |
| 59 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h", | 75 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h", |
| 60 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", | 76 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", |
| 61 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h", | 77 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h", |
| 78 "src/google/protobuf/stubs/atomic_sequence_num.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", | |
| 62 "src/google/protobuf/stubs/common.cc", | 83 "src/google/protobuf/stubs/common.cc", |
| 63 "src/google/protobuf/stubs/common.h", | 84 "src/google/protobuf/stubs/common.h", |
| 85 "src/google/protobuf/stubs/fastmem.h", | |
| 64 "src/google/protobuf/stubs/hash.h", | 86 "src/google/protobuf/stubs/hash.h", |
| 65 "src/google/protobuf/stubs/map-util.h", | 87 "src/google/protobuf/stubs/int128.cc", |
| 88 "src/google/protobuf/stubs/int128.h", | |
| 89 "src/google/protobuf/stubs/logging.h", | |
| 90 "src/google/protobuf/stubs/macros.h", | |
| 91 "src/google/protobuf/stubs/map_util.h", | |
| 92 "src/google/protobuf/stubs/mutex.h", | |
| 66 "src/google/protobuf/stubs/once.cc", | 93 "src/google/protobuf/stubs/once.cc", |
| 67 "src/google/protobuf/stubs/once.h", | 94 "src/google/protobuf/stubs/once.h", |
| 68 "src/google/protobuf/stubs/platform_macros.h", | 95 "src/google/protobuf/stubs/platform_macros.h", |
| 69 "src/google/protobuf/unknown_field_set.cc", | 96 "src/google/protobuf/stubs/port.h", |
| 70 "src/google/protobuf/unknown_field_set.h", | 97 "src/google/protobuf/stubs/scoped_ptr.h", |
| 98 "src/google/protobuf/stubs/shared_ptr.h", | |
| 99 "src/google/protobuf/stubs/status.cc", | |
| 100 "src/google/protobuf/stubs/status.h", | |
| 101 "src/google/protobuf/stubs/status_macros.h", | |
| 102 "src/google/protobuf/stubs/statusor.cc", | |
| 103 "src/google/protobuf/stubs/statusor.h", | |
| 104 "src/google/protobuf/stubs/stl_util.h", | |
| 105 "src/google/protobuf/stubs/stringpiece.cc", | |
| 106 "src/google/protobuf/stubs/stringpiece.h", | |
| 107 "src/google/protobuf/stubs/stringprintf.cc", | |
| 108 "src/google/protobuf/stubs/stringprintf.h", | |
| 109 "src/google/protobuf/stubs/structurally_valid.cc", | |
| 110 "src/google/protobuf/stubs/strutil.cc", | |
| 111 "src/google/protobuf/stubs/strutil.h", | |
| 112 "src/google/protobuf/stubs/template_util.h", | |
| 113 "src/google/protobuf/stubs/type_traits.h", | |
| 114 "src/google/protobuf/stubs/time.cc", | |
| 115 "src/google/protobuf/stubs/time.h", | |
| 71 "src/google/protobuf/wire_format_lite.cc", | 116 "src/google/protobuf/wire_format_lite.cc", |
| 72 "src/google/protobuf/wire_format_lite.h", | 117 "src/google/protobuf/wire_format_lite.h", |
| 73 "src/google/protobuf/wire_format_lite_inl.h", | 118 "src/google/protobuf/wire_format_lite_inl.h", |
| 74 "$config_h_dir/config.h", | |
| 75 ] | 119 ] |
| 76 | 120 |
| 77 protobuf_lite_cflags = [] | 121 protobuf_lite_cflags = [] |
| 78 if (is_win) { | 122 if (is_win) { |
| 79 protobuf_lite_cflags = [ | 123 protobuf_lite_cflags = [ |
| 80 "/wd4018", # Signed/unsigned mismatch in comparison. | 124 "/wd4018", # Signed/unsigned mismatch in comparison. |
| 125 "/wd4065", # switch statement contains 'default' but no 'case' labels | |
|
Peter Kasting
2016/04/13 02:11:45
Nit: Remove caps/trailing periods on the existing
xyzzyz
2016/04/14 00:23:57
Done.
| |
| 126 "/wd4146", # unary minus operator applied to unsigned type | |
| 81 "/wd4244", # Implicit conversion, possible loss of data. | 127 "/wd4244", # Implicit conversion, possible loss of data. |
| 82 "/wd4355", # 'this' used in base member initializer list. | |
| 83 "/wd4267", # Size_t to int truncation. | 128 "/wd4267", # Size_t to int truncation. |
| 84 "/wd4291", # No matching operator delete for a placement new. | 129 "/wd4291", # No matching operator delete for a placement new. |
| 130 "/wd4305", # double to float truncation | |
|
Peter Kasting
2016/04/13 02:11:45
FWIW, we should probably make sure at least 4146 a
xyzzyz
2016/04/14 00:23:57
That's a good idea. I don't have a Windows machine
Peter Kasting
2016/04/15 01:12:59
Don't necessarily worry about fixing. Just gettin
| |
| 131 "/wd4355", # 'this' used in base member initializer list. | |
| 132 "/wd4506", # no definition for inline function (protobuf issue #240) | |
| 85 ] | 133 ] |
| 86 } | 134 } |
| 87 | 135 |
| 88 component("protobuf_lite") { | 136 component("protobuf_lite") { |
| 89 sources = protobuf_lite_sources | 137 sources = protobuf_lite_sources |
| 90 | 138 |
| 91 configs -= [ "//build/config/compiler:chromium_code" ] | 139 configs -= [ "//build/config/compiler:chromium_code" ] |
| 92 configs += [ "//build/config/compiler:no_chromium_code" ] | 140 configs += [ |
| 141 "//build/config/compiler:no_chromium_code", | |
| 142 | |
| 143 # Must be after no_chromium_code for warning flags to be ordered | |
| 144 # correctly. | |
| 145 ":protobuf_warnings", | |
| 146 ] | |
| 147 | |
| 93 if (is_win) { | 148 if (is_win) { |
| 94 configs -= [ "//build/config/win:lean_and_mean" ] | 149 configs -= [ "//build/config/win:lean_and_mean" ] |
| 95 } | 150 } |
| 151 | |
| 96 public_configs = [ | 152 public_configs = [ |
| 97 ":protobuf_config", | 153 ":protobuf_config", |
| 98 | 154 |
| 99 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 155 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 100 "//build/config/compiler:no_size_t_to_int_warning", | 156 "//build/config/compiler:no_size_t_to_int_warning", |
| 101 ] | 157 ] |
| 102 | 158 |
| 159 deps = [ | |
| 160 "//build/config/sanitizers:deps", | |
| 161 ] | |
| 162 | |
| 103 cflags = protobuf_lite_cflags | 163 cflags = protobuf_lite_cflags |
| 104 | 164 |
| 105 # Required for component builds. See http://crbug.com/172800. | 165 # Required for component builds. See http://crbug.com/172800. |
| 106 if (is_component_build) { | 166 if (is_component_build) { |
| 107 public_configs += [ ":protobuf_use_dlls" ] | 167 public_configs += [ ":protobuf_use_dlls" ] |
| 108 defines = [ "LIBPROTOBUF_EXPORTS" ] | 168 defines = [ "LIBPROTOBUF_EXPORTS" ] |
| 109 } | 169 } |
| 110 } | 170 } |
| 111 | 171 |
| 112 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't | 172 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't |
| 113 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls | 173 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls |
| 114 # into that category. Do not use in Chrome code. | 174 # into that category. Do not use in Chrome code. |
| 115 | |
| 116 source_set("protobuf_full") { | 175 source_set("protobuf_full") { |
| 117 # Prevent people from depending on this outside our file. | 176 # Prevent people from depending on this outside our file. |
| 118 visibility = [ ":*" ] | 177 visibility = [ ":*" ] |
| 119 | 178 |
| 120 sources = protobuf_lite_sources | 179 sources = protobuf_lite_sources |
| 121 sources += [ | 180 sources += [ |
| 122 "src/google/protobuf/compiler/code_generator.h", | 181 "src/google/protobuf/any.cc", |
| 123 "src/google/protobuf/compiler/command_line_interface.h", | 182 "src/google/protobuf/any.h", |
| 183 "src/google/protobuf/any.pb.cc", | |
| 184 "src/google/protobuf/any.pb.h", | |
| 185 "src/google/protobuf/api.pb.cc", | |
| 186 "src/google/protobuf/api.pb.h", | |
| 187 "src/google/protobuf/compiler/importer.cc", | |
| 124 "src/google/protobuf/compiler/importer.h", | 188 "src/google/protobuf/compiler/importer.h", |
| 125 "src/google/protobuf/compiler/java/java_doc_comment.cc", | 189 "src/google/protobuf/compiler/parser.cc", |
| 126 "src/google/protobuf/compiler/java/java_doc_comment.h", | |
| 127 "src/google/protobuf/compiler/parser.h", | 190 "src/google/protobuf/compiler/parser.h", |
| 128 "src/google/protobuf/descriptor.cc", | 191 "src/google/protobuf/descriptor.cc", |
| 129 "src/google/protobuf/descriptor.h", | 192 "src/google/protobuf/descriptor.h", |
| 130 "src/google/protobuf/descriptor.pb.cc", | 193 "src/google/protobuf/descriptor.pb.cc", |
| 131 "src/google/protobuf/descriptor.pb.h", | 194 "src/google/protobuf/descriptor.pb.h", |
| 132 "src/google/protobuf/descriptor_database.cc", | 195 "src/google/protobuf/descriptor_database.cc", |
| 133 "src/google/protobuf/descriptor_database.h", | 196 "src/google/protobuf/descriptor_database.h", |
| 197 "src/google/protobuf/duration.pb.cc", | |
| 198 "src/google/protobuf/duration.pb.h", | |
| 134 "src/google/protobuf/dynamic_message.cc", | 199 "src/google/protobuf/dynamic_message.cc", |
| 135 "src/google/protobuf/dynamic_message.h", | 200 "src/google/protobuf/dynamic_message.h", |
| 201 "src/google/protobuf/empty.pb.cc", | |
| 202 "src/google/protobuf/empty.pb.h", | |
| 136 "src/google/protobuf/extension_set_heavy.cc", | 203 "src/google/protobuf/extension_set_heavy.cc", |
| 204 "src/google/protobuf/field_mask.pb.cc", | |
| 205 "src/google/protobuf/field_mask.pb.h", | |
| 137 "src/google/protobuf/generated_enum_reflection.h", | 206 "src/google/protobuf/generated_enum_reflection.h", |
| 207 "src/google/protobuf/generated_enum_util.h", | |
| 138 "src/google/protobuf/generated_message_reflection.cc", | 208 "src/google/protobuf/generated_message_reflection.cc", |
| 139 "src/google/protobuf/generated_message_reflection.h", | 209 "src/google/protobuf/generated_message_reflection.h", |
| 140 "src/google/protobuf/io/gzip_stream.h", | 210 |
| 211 # This file pulls in zlib, but it's not actually used by protoc, so | |
|
Peter Kasting
2016/04/13 02:11:44
Nit: This comment covers two files, so maybe say "
xyzzyz
2016/04/14 00:23:57
Done.
| |
| 212 # instead of compiling zlib for the host, let's just exclude this. | |
| 213 # "src/google/protobuf/io/gzip_stream.cc", | |
| 214 # "src/google/protobuf/io/gzip_stream.h", | |
|
Peter Kasting
2016/04/13 02:11:44
Nit: Blank line here
xyzzyz
2016/04/14 00:23:57
Done.
| |
| 215 "src/google/protobuf/io/printer.cc", | |
| 141 "src/google/protobuf/io/printer.h", | 216 "src/google/protobuf/io/printer.h", |
| 217 "src/google/protobuf/io/strtod.cc", | |
| 218 "src/google/protobuf/io/strtod.h", | |
| 219 "src/google/protobuf/io/tokenizer.cc", | |
| 142 "src/google/protobuf/io/tokenizer.h", | 220 "src/google/protobuf/io/tokenizer.h", |
| 221 "src/google/protobuf/io/zero_copy_stream_impl.cc", | |
| 143 "src/google/protobuf/io/zero_copy_stream_impl.h", | 222 "src/google/protobuf/io/zero_copy_stream_impl.h", |
| 223 "src/google/protobuf/map_entry.h", | |
| 224 "src/google/protobuf/map_field.cc", | |
| 225 "src/google/protobuf/map_field.h", | |
| 226 "src/google/protobuf/map_field_inl.h", | |
| 144 "src/google/protobuf/message.cc", | 227 "src/google/protobuf/message.cc", |
| 145 "src/google/protobuf/message.h", | 228 "src/google/protobuf/message.h", |
| 229 "src/google/protobuf/metadata.h", | |
| 230 "src/google/protobuf/reflection.h", | |
| 231 "src/google/protobuf/reflection_internal.h", | |
| 146 "src/google/protobuf/reflection_ops.cc", | 232 "src/google/protobuf/reflection_ops.cc", |
| 147 "src/google/protobuf/reflection_ops.h", | 233 "src/google/protobuf/reflection_ops.h", |
| 148 "src/google/protobuf/service.cc", | 234 "src/google/protobuf/service.cc", |
| 149 "src/google/protobuf/service.h", | 235 "src/google/protobuf/service.h", |
| 150 "src/google/protobuf/stubs/stl_util.h", | 236 "src/google/protobuf/source_context.pb.cc", |
| 151 "src/google/protobuf/stubs/stringprintf.cc", | 237 "src/google/protobuf/source_context.pb.h", |
| 152 "src/google/protobuf/stubs/stringprintf.h", | 238 "src/google/protobuf/struct.pb.cc", |
| 153 "src/google/protobuf/stubs/structurally_valid.cc", | 239 "src/google/protobuf/struct.pb.h", |
| 154 "src/google/protobuf/stubs/strutil.cc", | 240 "src/google/protobuf/stubs/mathlimits.cc", |
| 155 "src/google/protobuf/stubs/strutil.h", | 241 "src/google/protobuf/stubs/mathlimits.h", |
| 242 "src/google/protobuf/stubs/mathutil.h", | |
| 243 "src/google/protobuf/stubs/singleton.h", | |
| 156 "src/google/protobuf/stubs/substitute.cc", | 244 "src/google/protobuf/stubs/substitute.cc", |
| 157 "src/google/protobuf/stubs/substitute.h", | 245 "src/google/protobuf/stubs/substitute.h", |
| 158 "src/google/protobuf/stubs/template_util.h", | |
| 159 "src/google/protobuf/stubs/type_traits.h", | |
| 160 "src/google/protobuf/text_format.cc", | 246 "src/google/protobuf/text_format.cc", |
| 161 "src/google/protobuf/text_format.h", | 247 "src/google/protobuf/text_format.h", |
| 248 "src/google/protobuf/timestamp.pb.cc", | |
| 249 "src/google/protobuf/timestamp.pb.h", | |
| 250 "src/google/protobuf/type.pb.cc", | |
| 251 "src/google/protobuf/type.pb.h", | |
| 252 "src/google/protobuf/unknown_field_set.cc", | |
| 253 "src/google/protobuf/unknown_field_set.h", | |
| 254 "src/google/protobuf/util/field_comparator.cc", | |
| 255 "src/google/protobuf/util/field_comparator.h", | |
| 256 "src/google/protobuf/util/field_mask_util.cc", | |
| 257 "src/google/protobuf/util/field_mask_util.h", | |
| 258 "src/google/protobuf/util/internal/constants.h", | |
| 259 "src/google/protobuf/util/internal/datapiece.cc", | |
| 260 "src/google/protobuf/util/internal/datapiece.h", | |
| 261 "src/google/protobuf/util/internal/default_value_objectwriter.cc", | |
| 262 "src/google/protobuf/util/internal/default_value_objectwriter.h", | |
| 263 "src/google/protobuf/util/internal/error_listener.cc", | |
| 264 "src/google/protobuf/util/internal/error_listener.h", | |
| 265 "src/google/protobuf/util/internal/field_mask_utility.cc", | |
| 266 "src/google/protobuf/util/internal/field_mask_utility.h", | |
| 267 "src/google/protobuf/util/internal/json_escaping.cc", | |
| 268 "src/google/protobuf/util/internal/json_escaping.h", | |
| 269 "src/google/protobuf/util/internal/json_objectwriter.cc", | |
| 270 "src/google/protobuf/util/internal/json_objectwriter.h", | |
| 271 "src/google/protobuf/util/internal/json_stream_parser.cc", | |
| 272 "src/google/protobuf/util/internal/json_stream_parser.h", | |
| 273 "src/google/protobuf/util/internal/location_tracker.h", | |
| 274 "src/google/protobuf/util/internal/object_location_tracker.h", | |
| 275 "src/google/protobuf/util/internal/object_source.h", | |
| 276 "src/google/protobuf/util/internal/object_writer.cc", | |
| 277 "src/google/protobuf/util/internal/object_writer.h", | |
| 278 "src/google/protobuf/util/internal/proto_writer.cc", | |
| 279 "src/google/protobuf/util/internal/proto_writer.h", | |
| 280 "src/google/protobuf/util/internal/protostream_objectsource.cc", | |
| 281 "src/google/protobuf/util/internal/protostream_objectsource.h", | |
| 282 "src/google/protobuf/util/internal/protostream_objectwriter.cc", | |
| 283 "src/google/protobuf/util/internal/protostream_objectwriter.h", | |
| 284 "src/google/protobuf/util/internal/structured_object_writer.h", | |
| 285 "src/google/protobuf/util/internal/type_info.cc", | |
| 286 "src/google/protobuf/util/internal/type_info.h", | |
| 287 "src/google/protobuf/util/internal/type_info_test_helper.cc", | |
| 288 "src/google/protobuf/util/internal/type_info_test_helper.h", | |
| 289 "src/google/protobuf/util/internal/utility.cc", | |
| 290 "src/google/protobuf/util/internal/utility.h", | |
| 291 "src/google/protobuf/util/json_util.cc", | |
| 292 "src/google/protobuf/util/json_util.h", | |
| 293 "src/google/protobuf/util/message_differencer.cc", | |
| 294 "src/google/protobuf/util/message_differencer.h", | |
| 295 "src/google/protobuf/util/time_util.cc", | |
| 296 "src/google/protobuf/util/time_util.h", | |
| 297 "src/google/protobuf/util/type_resolver.h", | |
| 298 "src/google/protobuf/util/type_resolver_util.cc", | |
| 299 "src/google/protobuf/util/type_resolver_util.h", | |
| 162 "src/google/protobuf/wire_format.cc", | 300 "src/google/protobuf/wire_format.cc", |
| 163 "src/google/protobuf/wire_format.h", | 301 "src/google/protobuf/wire_format.h", |
| 164 | 302 "src/google/protobuf/wrappers.pb.cc", |
| 165 # This file pulls in zlib, but it's not actually used by protoc, so | 303 "src/google/protobuf/wrappers.pb.h", |
| 166 # instead of compiling zlib for the host, let's just exclude this. | |
| 167 # "src/src/google/protobuf/io/gzip_stream.cc", | |
| 168 "src/google/protobuf/compiler/importer.cc", | |
| 169 "src/google/protobuf/compiler/parser.cc", | |
| 170 "src/google/protobuf/io/printer.cc", | |
| 171 "src/google/protobuf/io/tokenizer.cc", | |
| 172 "src/google/protobuf/io/zero_copy_stream_impl.cc", | |
| 173 ] | 304 ] |
| 174 | 305 |
| 175 configs -= [ "//build/config/compiler:chromium_code" ] | 306 configs -= [ "//build/config/compiler:chromium_code" ] |
| 176 configs += [ "//build/config/compiler:no_chromium_code" ] | 307 configs += [ |
| 308 "//build/config/compiler:no_chromium_code", | |
| 309 | |
| 310 # Must be after no_chromium_code for warning flags to be ordered | |
| 311 # correctly. | |
| 312 ":protobuf_warnings", | |
| 313 ] | |
| 177 if (is_win) { | 314 if (is_win) { |
| 178 configs -= [ "//build/config/win:lean_and_mean" ] | 315 configs -= [ "//build/config/win:lean_and_mean" ] |
| 179 } | 316 } |
| 180 public_configs = [ | 317 public_configs = [ |
| 181 ":protobuf_config", | 318 ":protobuf_config", |
| 182 | 319 |
| 183 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 320 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 184 "//build/config/compiler:no_size_t_to_int_warning", | 321 "//build/config/compiler:no_size_t_to_int_warning", |
| 185 ] | 322 ] |
| 186 | 323 |
| 187 cflags = protobuf_lite_cflags | 324 cflags = protobuf_lite_cflags |
| 188 } | 325 } |
| 189 | 326 |
| 190 # Only compile the compiler for the host architecture. | 327 # Only compile the compiler for the host architecture. |
| 191 if (current_toolchain == host_toolchain) { | 328 if (current_toolchain == host_toolchain) { |
| 192 executable("protoc") { | 329 executable("protoc") { |
| 193 sources = [ | 330 sources = [ |
| 194 "src/google/protobuf/compiler/code_generator.cc", | 331 "src/google/protobuf/compiler/code_generator.cc", |
| 332 "src/google/protobuf/compiler/code_generator.h", | |
| 195 "src/google/protobuf/compiler/command_line_interface.cc", | 333 "src/google/protobuf/compiler/command_line_interface.cc", |
| 334 "src/google/protobuf/compiler/command_line_interface.h", | |
| 196 "src/google/protobuf/compiler/cpp/cpp_enum.cc", | 335 "src/google/protobuf/compiler/cpp/cpp_enum.cc", |
| 197 "src/google/protobuf/compiler/cpp/cpp_enum.h", | 336 "src/google/protobuf/compiler/cpp/cpp_enum.h", |
| 198 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", | 337 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", |
| 199 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", | 338 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", |
| 200 "src/google/protobuf/compiler/cpp/cpp_extension.cc", | 339 "src/google/protobuf/compiler/cpp/cpp_extension.cc", |
| 201 "src/google/protobuf/compiler/cpp/cpp_extension.h", | 340 "src/google/protobuf/compiler/cpp/cpp_extension.h", |
| 202 "src/google/protobuf/compiler/cpp/cpp_field.cc", | 341 "src/google/protobuf/compiler/cpp/cpp_field.cc", |
| 203 "src/google/protobuf/compiler/cpp/cpp_field.h", | 342 "src/google/protobuf/compiler/cpp/cpp_field.h", |
| 204 "src/google/protobuf/compiler/cpp/cpp_file.cc", | 343 "src/google/protobuf/compiler/cpp/cpp_file.cc", |
| 205 "src/google/protobuf/compiler/cpp/cpp_file.h", | 344 "src/google/protobuf/compiler/cpp/cpp_file.h", |
| 206 "src/google/protobuf/compiler/cpp/cpp_generator.cc", | 345 "src/google/protobuf/compiler/cpp/cpp_generator.cc", |
| 346 "src/google/protobuf/compiler/cpp/cpp_generator.h", | |
| 207 "src/google/protobuf/compiler/cpp/cpp_helpers.cc", | 347 "src/google/protobuf/compiler/cpp/cpp_helpers.cc", |
| 208 "src/google/protobuf/compiler/cpp/cpp_helpers.h", | 348 "src/google/protobuf/compiler/cpp/cpp_helpers.h", |
| 349 "src/google/protobuf/compiler/cpp/cpp_map_field.cc", | |
| 350 "src/google/protobuf/compiler/cpp/cpp_map_field.h", | |
| 209 "src/google/protobuf/compiler/cpp/cpp_message.cc", | 351 "src/google/protobuf/compiler/cpp/cpp_message.cc", |
| 210 "src/google/protobuf/compiler/cpp/cpp_message.h", | 352 "src/google/protobuf/compiler/cpp/cpp_message.h", |
| 211 "src/google/protobuf/compiler/cpp/cpp_message_field.cc", | 353 "src/google/protobuf/compiler/cpp/cpp_message_field.cc", |
| 212 "src/google/protobuf/compiler/cpp/cpp_message_field.h", | 354 "src/google/protobuf/compiler/cpp/cpp_message_field.h", |
| 355 "src/google/protobuf/compiler/cpp/cpp_options.h", | |
| 213 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", | 356 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", |
| 214 "src/google/protobuf/compiler/cpp/cpp_primitive_field.h", | 357 "src/google/protobuf/compiler/cpp/cpp_primitive_field.h", |
| 215 "src/google/protobuf/compiler/cpp/cpp_service.cc", | 358 "src/google/protobuf/compiler/cpp/cpp_service.cc", |
| 216 "src/google/protobuf/compiler/cpp/cpp_service.h", | 359 "src/google/protobuf/compiler/cpp/cpp_service.h", |
| 217 "src/google/protobuf/compiler/cpp/cpp_string_field.cc", | 360 "src/google/protobuf/compiler/cpp/cpp_string_field.cc", |
| 218 "src/google/protobuf/compiler/cpp/cpp_string_field.h", | 361 "src/google/protobuf/compiler/cpp/cpp_string_field.h", |
| 219 "src/google/protobuf/compiler/java/java_enum.cc", | |
| 220 "src/google/protobuf/compiler/java/java_enum.h", | |
| 221 "src/google/protobuf/compiler/java/java_enum_field.cc", | |
| 222 "src/google/protobuf/compiler/java/java_enum_field.h", | |
| 223 "src/google/protobuf/compiler/java/java_extension.cc", | |
| 224 "src/google/protobuf/compiler/java/java_extension.h", | |
| 225 "src/google/protobuf/compiler/java/java_field.cc", | |
| 226 "src/google/protobuf/compiler/java/java_field.h", | |
| 227 "src/google/protobuf/compiler/java/java_file.cc", | |
| 228 "src/google/protobuf/compiler/java/java_file.h", | |
| 229 "src/google/protobuf/compiler/java/java_generator.cc", | |
| 230 "src/google/protobuf/compiler/java/java_helpers.cc", | |
| 231 "src/google/protobuf/compiler/java/java_helpers.h", | |
| 232 "src/google/protobuf/compiler/java/java_message.cc", | |
| 233 "src/google/protobuf/compiler/java/java_message.h", | |
| 234 "src/google/protobuf/compiler/java/java_message_field.cc", | |
| 235 "src/google/protobuf/compiler/java/java_message_field.h", | |
| 236 "src/google/protobuf/compiler/java/java_primitive_field.cc", | |
| 237 "src/google/protobuf/compiler/java/java_primitive_field.h", | |
| 238 "src/google/protobuf/compiler/java/java_service.cc", | |
| 239 "src/google/protobuf/compiler/java/java_service.h", | |
| 240 "src/google/protobuf/compiler/java/java_string_field.cc", | |
| 241 "src/google/protobuf/compiler/java/java_string_field.h", | |
| 242 "src/google/protobuf/compiler/main.cc", | 362 "src/google/protobuf/compiler/main.cc", |
| 243 "src/google/protobuf/compiler/plugin.cc", | 363 "src/google/protobuf/compiler/plugin.cc", |
| 364 "src/google/protobuf/compiler/plugin.h", | |
| 244 "src/google/protobuf/compiler/plugin.pb.cc", | 365 "src/google/protobuf/compiler/plugin.pb.cc", |
| 366 "src/google/protobuf/compiler/plugin.pb.h", | |
| 245 "src/google/protobuf/compiler/python/python_generator.cc", | 367 "src/google/protobuf/compiler/python/python_generator.cc", |
| 368 "src/google/protobuf/compiler/python/python_generator.h", | |
| 246 "src/google/protobuf/compiler/subprocess.cc", | 369 "src/google/protobuf/compiler/subprocess.cc", |
| 247 "src/google/protobuf/compiler/subprocess.h", | 370 "src/google/protobuf/compiler/subprocess.h", |
| 248 "src/google/protobuf/compiler/zip_writer.cc", | 371 "src/google/protobuf/compiler/zip_writer.cc", |
| 249 "src/google/protobuf/compiler/zip_writer.h", | 372 "src/google/protobuf/compiler/zip_writer.h", |
| 250 ] | 373 ] |
| 251 | 374 |
| 252 configs -= [ "//build/config/compiler:chromium_code" ] | 375 configs -= [ "//build/config/compiler:chromium_code" ] |
| 253 configs += [ "//build/config/compiler:no_chromium_code" ] | 376 configs += [ |
| 377 "//build/config/compiler:no_chromium_code", | |
| 378 | |
| 379 # Must be after no_chromium_code for warning flags to be ordered | |
| 380 # correctly. | |
| 381 ":protobuf_warnings", | |
| 382 ] | |
| 254 if (is_win) { | 383 if (is_win) { |
| 255 # This is defined internally, don't warn on duplicate. | 384 # This is defined internally, don't warn on duplicate. |
| 256 configs -= [ "//build/config/win:lean_and_mean" ] | 385 configs -= [ "//build/config/win:lean_and_mean" ] |
| 257 } | 386 } |
| 258 | 387 |
| 259 cflags = protobuf_lite_cflags | 388 cflags = protobuf_lite_cflags |
| 260 | 389 |
| 261 deps = [ | 390 deps = [ |
| 262 ":protobuf_full", | 391 ":protobuf_full", |
| 263 "//build/config/sanitizers:deps", | 392 "//build/config/sanitizers:deps", |
| 264 ] | 393 ] |
| 265 deps += [ "//build/config/sanitizers:deps" ] | 394 deps += [ "//build/config/sanitizers:deps" ] |
| 266 } | 395 } |
| 267 } | 396 } |
| 268 | 397 |
| 269 google_python_dir = "$root_out_dir/pyproto/google" | 398 google_python_dir = "$root_out_dir/pyproto/google" |
| 270 | 399 |
| 271 copy("copy_google") { | 400 copy("copy_google") { |
| 272 sources = [ | 401 sources = [ |
| 273 "__init__.py", | 402 "__init__.py", |
| 274 ] | 403 ] |
| 275 outputs = [ | 404 outputs = [ |
| 276 "$google_python_dir/{{source_file_part}}", | 405 "$google_python_dir/{{source_file_part}}", |
| 277 ] | 406 ] |
| 278 } | 407 } |
| 279 | 408 |
| 409 copy("copy_six") { | |
| 410 sources = [ | |
| 411 "third_party/six/six.py", | |
| 412 ] | |
| 413 outputs = [ | |
| 414 "$google_python_dir/third_party/six/{{source_file_part}}", | |
| 415 ] | |
| 416 } | |
| 417 | |
| 280 copy("copy_google_protobuf") { | 418 copy("copy_google_protobuf") { |
| 281 sources = [ | 419 sources = [ |
| 282 "python/google/protobuf/__init__.py", | 420 "python/google/protobuf/__init__.py", |
| 283 "python/google/protobuf/descriptor.py", | 421 "python/google/protobuf/descriptor.py", |
| 284 "python/google/protobuf/descriptor_database.py", | 422 "python/google/protobuf/descriptor_database.py", |
| 285 "python/google/protobuf/descriptor_pool.py", | 423 "python/google/protobuf/descriptor_pool.py", |
| 424 "python/google/protobuf/json_format.py", | |
| 286 "python/google/protobuf/message.py", | 425 "python/google/protobuf/message.py", |
| 287 "python/google/protobuf/message_factory.py", | 426 "python/google/protobuf/message_factory.py", |
| 427 "python/google/protobuf/proto_builder.py", | |
| 288 "python/google/protobuf/reflection.py", | 428 "python/google/protobuf/reflection.py", |
| 289 "python/google/protobuf/service.py", | 429 "python/google/protobuf/service.py", |
| 290 "python/google/protobuf/service_reflection.py", | 430 "python/google/protobuf/service_reflection.py", |
| 431 "python/google/protobuf/symbol_database.py", | |
| 432 "python/google/protobuf/text_encoding.py", | |
| 291 "python/google/protobuf/text_format.py", | 433 "python/google/protobuf/text_format.py", |
| 292 | 434 |
| 293 # TODO(ncarter): protoc"s python generator treats | 435 # TODO(ncarter): protoc"s python generator treats |
| 294 # descriptor.proto specially, but it's not possible to trigger | 436 # descriptor.proto specially, but it's not possible to trigger |
| 295 # the special treatment unless you run protoc from ./src/src | 437 # the special treatment unless you run protoc from ./src/src |
| 296 # (the treatment is based on the path to the .proto file | 438 # (the treatment is based on the path to the .proto file |
| 297 # matching a constant exactly). I'm not sure how to convince | 439 # matching a constant exactly). I'm not sure how to convince |
| 298 # gyp to execute a rule from a different directory. Until this | 440 # gyp to execute a rule from a different directory. Until this |
| 299 # is resolved, use a copy of descriptor_pb2.py that I manually | 441 # is resolved, use a copy of descriptor_pb2.py that I manually |
| 300 # generated. | 442 # generated. |
|
Peter Kasting
2016/04/13 02:11:44
Nit: This comment is somewhat inaccurate in multip
xyzzyz
2016/04/14 00:23:57
Done.
| |
| 301 "descriptor_pb2.py", | 443 "python/google/protobuf/descriptor_pb2.py", |
| 302 ] | 444 ] |
| 303 outputs = [ | 445 outputs = [ |
| 304 "$google_python_dir/protobuf/{{source_file_part}}", | 446 "$google_python_dir/protobuf/{{source_file_part}}", |
| 305 ] | 447 ] |
| 306 } | 448 } |
| 307 | 449 |
| 308 copy("copy_google_protobuf_internal") { | 450 copy("copy_google_protobuf_internal") { |
| 309 sources = [ | 451 sources = [ |
| 310 "python/google/protobuf/internal/__init__.py", | 452 "python/google/protobuf/internal/__init__.py", |
| 453 "python/google/protobuf/internal/_parameterized.py", | |
| 311 "python/google/protobuf/internal/api_implementation.py", | 454 "python/google/protobuf/internal/api_implementation.py", |
| 312 "python/google/protobuf/internal/containers.py", | 455 "python/google/protobuf/internal/containers.py", |
| 313 "python/google/protobuf/internal/cpp_message.py", | |
| 314 "python/google/protobuf/internal/decoder.py", | 456 "python/google/protobuf/internal/decoder.py", |
| 315 "python/google/protobuf/internal/encoder.py", | 457 "python/google/protobuf/internal/encoder.py", |
| 316 "python/google/protobuf/internal/enum_type_wrapper.py", | 458 "python/google/protobuf/internal/enum_type_wrapper.py", |
| 317 "python/google/protobuf/internal/generator_test.py", | |
| 318 "python/google/protobuf/internal/message_listener.py", | 459 "python/google/protobuf/internal/message_listener.py", |
| 319 "python/google/protobuf/internal/python_message.py", | 460 "python/google/protobuf/internal/python_message.py", |
| 320 "python/google/protobuf/internal/type_checkers.py", | 461 "python/google/protobuf/internal/type_checkers.py", |
| 462 "python/google/protobuf/internal/well_known_types.py", | |
| 321 "python/google/protobuf/internal/wire_format.py", | 463 "python/google/protobuf/internal/wire_format.py", |
| 322 ] | 464 ] |
| 323 outputs = [ | 465 outputs = [ |
| 324 "$google_python_dir/protobuf/internal/{{source_file_part}}", | 466 "$google_python_dir/protobuf/internal/{{source_file_part}}", |
| 325 ] | 467 ] |
| 326 } | 468 } |
| 327 | 469 |
|
Peter Kasting
2016/04/13 02:11:44
My patch had a "copy_google_protobuf_pyext" step h
xyzzyz
2016/04/14 00:23:57
I'm not sure if these are at all necessary. Nothin
| |
| 328 group("py_proto") { | 470 group("py_proto") { |
| 329 public_deps = [ | 471 public_deps = [ |
| 330 ":copy_google", | 472 ":copy_google", |
| 331 ":copy_google_protobuf", | 473 ":copy_google_protobuf", |
| 332 ":copy_google_protobuf_internal", | 474 ":copy_google_protobuf_internal", |
| 475 ":copy_six", | |
| 333 ] | 476 ] |
| 334 | 477 |
| 335 # Targets that depend on this should depend on the copied data files. | 478 # Targets that depend on this should depend on the copied data files. |
| 336 data = get_target_outputs(":copy_google") | 479 data = get_target_outputs(":copy_google") |
| 480 data += get_target_outputs(":copy_six") | |
| 337 data += get_target_outputs(":copy_google_protobuf") | 481 data += get_target_outputs(":copy_google_protobuf") |
| 338 data += get_target_outputs(":copy_google_protobuf_internal") | 482 data += get_target_outputs(":copy_google_protobuf_internal") |
| 339 } | 483 } |
| OLD | NEW |