Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
|
Peter Kasting
2016/04/06 22:35:39
Nit: Don't update copyrights when touching files
xyzzyz
2016/04/07 18:55:03
Huh, I don't remember doing it. Weird.
| |
| 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", |
| 10 "HAVE_ZLIB", | |
|
Peter Kasting
2016/04/06 22:35:39
Do you really need this?
xyzzyz
2016/04/07 18:55:03
I actually don't, thanks!
| |
| 19 ] | 11 ] |
| 12 if (!is_win) { | |
| 13 defines += [ "HAVE_PTHREAD" ] | |
|
Peter Kasting
2016/04/06 22:35:40
I don't think you actually need to exclude Windows
xyzzyz
2016/04/07 18:55:03
Yeah, the way the ifdefs in protobuf are structure
| |
| 14 } | |
| 15 } | |
| 16 | |
| 17 config("protobuf_warnings") { | |
| 18 cflags = [] | |
| 19 if (is_clang) { | |
| 20 # protobuf-3 contains a few functions that are unused. | |
|
Peter Kasting
2016/04/06 22:35:39
Can these be removed upstream via a patch?
xyzzyz
2016/04/07 18:55:03
This is my plan -- I already made some pull reques
| |
| 21 cflags += [ "-Wno-unused-function" ] | |
| 22 } | |
| 20 } | 23 } |
| 21 | 24 |
| 22 if (is_component_build) { | 25 if (is_component_build) { |
| 23 config("protobuf_use_dlls") { | 26 config("protobuf_use_dlls") { |
| 24 defines = [ "PROTOBUF_USE_DLLS" ] | 27 defines = [ "PROTOBUF_USE_DLLS" ] |
| 25 } | 28 } |
| 26 } | 29 } |
| 27 | 30 |
| 28 # This config should be applied to targets using generated code from the proto | 31 # This config should be applied to targets using generated code from the proto |
| 29 # compiler. It sets up the include directories properly. | 32 # compiler. It sets up the include directories properly. |
| 30 config("using_proto") { | 33 config("using_proto") { |
| 31 include_dirs = [ | 34 include_dirs = [ |
| 32 "src", | 35 "src", |
| 33 "$root_gen_dir/protoc_out", | 36 "$root_gen_dir/protoc_out", |
| 34 ] | 37 ] |
| 35 } | 38 } |
| 36 | 39 |
| 37 protobuf_lite_sources = [ | 40 protobuf_lite_sources = [ |
| 41 "src/google/protobuf/arena.cc", | |
| 42 "src/google/protobuf/arena.h", | |
| 43 "src/google/protobuf/arenastring.cc", | |
| 44 "src/google/protobuf/arenastring.h", | |
|
Peter Kasting
2016/04/06 22:35:40
See my comments in protobuf_lite.gypi regarding th
xyzzyz
2016/04/07 18:55:03
See my answer there.
| |
| 38 "src/google/protobuf/extension_set.cc", | 45 "src/google/protobuf/extension_set.cc", |
| 39 "src/google/protobuf/extension_set.h", | 46 "src/google/protobuf/extension_set.h", |
| 40 "src/google/protobuf/generated_message_util.cc", | 47 "src/google/protobuf/generated_message_util.cc", |
| 41 "src/google/protobuf/generated_message_util.h", | 48 "src/google/protobuf/generated_message_util.h", |
| 42 "src/google/protobuf/io/coded_stream.cc", | 49 "src/google/protobuf/io/coded_stream.cc", |
| 43 "src/google/protobuf/io/coded_stream.h", | 50 "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", | 51 "src/google/protobuf/io/zero_copy_stream.cc", |
| 46 "src/google/protobuf/io/zero_copy_stream.h", | 52 "src/google/protobuf/io/zero_copy_stream.h", |
| 47 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", | 53 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", |
| 48 "src/google/protobuf/io/zero_copy_stream_impl_lite.h", | 54 "src/google/protobuf/io/zero_copy_stream_impl_lite.h", |
| 49 "src/google/protobuf/message_lite.cc", | 55 "src/google/protobuf/message_lite.cc", |
| 50 "src/google/protobuf/message_lite.h", | 56 "src/google/protobuf/message_lite.h", |
| 51 "src/google/protobuf/repeated_field.cc", | 57 "src/google/protobuf/repeated_field.cc", |
| 52 "src/google/protobuf/repeated_field.h", | 58 "src/google/protobuf/repeated_field.h", |
| 53 "src/google/protobuf/stubs/atomicops.h", | |
| 54 "src/google/protobuf/stubs/atomicops_internals_arm_gcc.h", | |
| 55 "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h", | |
| 56 "src/google/protobuf/stubs/atomicops_internals_macosx.h", | |
| 57 "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h", | |
| 58 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", | 59 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", |
| 59 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h", | 60 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h", |
| 60 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", | 61 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", |
| 61 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h", | 62 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h", |
| 63 "src/google/protobuf/stubs/bytestream.cc", | |
| 64 "src/google/protobuf/stubs/bytestream.h", | |
| 62 "src/google/protobuf/stubs/common.cc", | 65 "src/google/protobuf/stubs/common.cc", |
| 63 "src/google/protobuf/stubs/common.h", | 66 "src/google/protobuf/stubs/common.h", |
| 64 "src/google/protobuf/stubs/hash.h", | 67 "src/google/protobuf/stubs/int128.cc", |
| 65 "src/google/protobuf/stubs/map-util.h", | 68 "src/google/protobuf/stubs/int128.h", |
| 66 "src/google/protobuf/stubs/once.cc", | 69 "src/google/protobuf/stubs/once.cc", |
| 67 "src/google/protobuf/stubs/once.h", | 70 "src/google/protobuf/stubs/once.h", |
| 68 "src/google/protobuf/stubs/platform_macros.h", | 71 "src/google/protobuf/stubs/status.cc", |
| 69 "src/google/protobuf/unknown_field_set.cc", | 72 "src/google/protobuf/stubs/status.h", |
| 70 "src/google/protobuf/unknown_field_set.h", | 73 "src/google/protobuf/stubs/statusor.cc", |
| 74 "src/google/protobuf/stubs/statusor.h", | |
| 75 "src/google/protobuf/stubs/stringpiece.cc", | |
| 76 "src/google/protobuf/stubs/stringpiece.h", | |
| 77 "src/google/protobuf/stubs/stringprintf.cc", | |
| 78 "src/google/protobuf/stubs/stringprintf.h", | |
| 79 "src/google/protobuf/stubs/structurally_valid.cc", | |
| 80 "src/google/protobuf/stubs/strutil.cc", | |
| 81 "src/google/protobuf/stubs/strutil.h", | |
| 82 "src/google/protobuf/stubs/time.cc", | |
| 83 "src/google/protobuf/stubs/time.h", | |
| 71 "src/google/protobuf/wire_format_lite.cc", | 84 "src/google/protobuf/wire_format_lite.cc", |
| 72 "src/google/protobuf/wire_format_lite.h", | 85 "src/google/protobuf/wire_format_lite.h", |
| 73 "src/google/protobuf/wire_format_lite_inl.h", | |
| 74 "$config_h_dir/config.h", | |
| 75 ] | 86 ] |
| 76 | 87 |
| 77 protobuf_lite_cflags = [] | 88 protobuf_lite_cflags = [] |
| 78 if (is_win) { | 89 if (is_win) { |
| 79 protobuf_lite_cflags = [ | 90 protobuf_lite_cflags = [ |
| 80 "/wd4018", # Signed/unsigned mismatch in comparison. | 91 "/wd4018", # Signed/unsigned mismatch in comparison. |
| 81 "/wd4244", # Implicit conversion, possible loss of data. | 92 "/wd4244", # Implicit conversion, possible loss of data. |
| 82 "/wd4355", # 'this' used in base member initializer list. | 93 "/wd4355", # 'this' used in base member initializer list. |
| 83 "/wd4267", # Size_t to int truncation. | 94 "/wd4267", # Size_t to int truncation. |
| 84 "/wd4291", # No matching operator delete for a placement new. | 95 "/wd4291", # No matching operator delete for a placement new. |
| 96 "/wd4305", # double to float truncation | |
| 97 "/wd4065", # switch statement contains 'default' but no 'case' labels | |
|
Peter Kasting
2016/04/06 22:35:39
Keep this list in sorted order.
xyzzyz
2016/04/07 18:55:03
Done.
| |
| 98 "/wd4506", # no definition for inline function (protobuf issue #240) | |
| 99 "/wd4146", # unary minus operator applied to unsigned type | |
| 85 ] | 100 ] |
| 86 } | 101 } |
| 87 | 102 |
| 88 component("protobuf_lite") { | 103 component("protobuf_lite") { |
| 89 sources = protobuf_lite_sources | 104 sources = protobuf_lite_sources |
| 90 | 105 |
| 91 configs -= [ "//build/config/compiler:chromium_code" ] | 106 configs -= [ "//build/config/compiler:chromium_code" ] |
| 92 configs += [ "//build/config/compiler:no_chromium_code" ] | 107 configs += [ |
| 108 "//build/config/compiler:no_chromium_code", | |
| 109 | |
| 110 # Must be after no_chromium_code for warning flags to be ordered | |
| 111 # correctly. | |
| 112 ":protobuf_warnings", | |
| 113 ] | |
| 114 | |
| 93 if (is_win) { | 115 if (is_win) { |
| 94 configs -= [ "//build/config/win:lean_and_mean" ] | 116 configs -= [ "//build/config/win:lean_and_mean" ] |
| 95 } | 117 } |
| 118 | |
| 96 public_configs = [ | 119 public_configs = [ |
| 97 ":protobuf_config", | 120 ":protobuf_config", |
| 98 | 121 |
| 99 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 122 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 100 "//build/config/compiler:no_size_t_to_int_warning", | 123 "//build/config/compiler:no_size_t_to_int_warning", |
| 101 ] | 124 ] |
| 102 | 125 |
| 126 deps = [ | |
| 127 "//build/config/sanitizers:deps", | |
| 128 ] | |
| 129 | |
| 103 cflags = protobuf_lite_cflags | 130 cflags = protobuf_lite_cflags |
| 104 | 131 |
| 105 # Required for component builds. See http://crbug.com/172800. | 132 # Required for component builds. See http://crbug.com/172800. |
| 106 if (is_component_build) { | 133 if (is_component_build) { |
| 107 public_configs += [ ":protobuf_use_dlls" ] | 134 public_configs += [ ":protobuf_use_dlls" ] |
| 108 defines = [ "LIBPROTOBUF_EXPORTS" ] | 135 defines = [ "LIBPROTOBUF_EXPORTS" ] |
| 109 } | 136 } |
| 110 } | 137 } |
| 111 | 138 |
| 112 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't | 139 # 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 | 140 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls |
| 114 # into that category. Do not use in Chrome code. | 141 # into that category. Do not use in Chrome code. |
| 115 | |
| 116 source_set("protobuf_full") { | 142 source_set("protobuf_full") { |
| 117 # Prevent people from depending on this outside our file. | 143 # Prevent people from depending on this outside our file. |
| 118 visibility = [ ":*" ] | 144 visibility = [ ":*" ] |
| 119 | 145 |
| 120 sources = protobuf_lite_sources | 146 sources = protobuf_lite_sources |
| 121 sources += [ | 147 sources += [ |
| 122 "src/google/protobuf/compiler/code_generator.h", | 148 "src/google/protobuf/any.cc", |
| 123 "src/google/protobuf/compiler/command_line_interface.h", | 149 "src/google/protobuf/any.h", |
| 150 "src/google/protobuf/any.pb.cc", | |
| 151 "src/google/protobuf/any.pb.h", | |
| 152 "src/google/protobuf/api.pb.cc", | |
| 153 "src/google/protobuf/api.pb.h", | |
| 154 "src/google/protobuf/compiler/importer.cc", | |
| 124 "src/google/protobuf/compiler/importer.h", | 155 "src/google/protobuf/compiler/importer.h", |
| 125 "src/google/protobuf/compiler/java/java_doc_comment.cc", | 156 "src/google/protobuf/compiler/parser.cc", |
| 126 "src/google/protobuf/compiler/java/java_doc_comment.h", | |
| 127 "src/google/protobuf/compiler/parser.h", | 157 "src/google/protobuf/compiler/parser.h", |
| 128 "src/google/protobuf/descriptor.cc", | 158 "src/google/protobuf/descriptor.cc", |
| 129 "src/google/protobuf/descriptor.h", | 159 "src/google/protobuf/descriptor.h", |
| 130 "src/google/protobuf/descriptor.pb.cc", | 160 "src/google/protobuf/descriptor.pb.cc", |
| 131 "src/google/protobuf/descriptor.pb.h", | 161 "src/google/protobuf/descriptor.pb.h", |
| 132 "src/google/protobuf/descriptor_database.cc", | 162 "src/google/protobuf/descriptor_database.cc", |
| 133 "src/google/protobuf/descriptor_database.h", | 163 "src/google/protobuf/descriptor_database.h", |
| 164 "src/google/protobuf/duration.pb.cc", | |
| 165 "src/google/protobuf/duration.pb.h", | |
| 134 "src/google/protobuf/dynamic_message.cc", | 166 "src/google/protobuf/dynamic_message.cc", |
| 135 "src/google/protobuf/dynamic_message.h", | 167 "src/google/protobuf/dynamic_message.h", |
| 168 "src/google/protobuf/empty.pb.cc", | |
| 169 "src/google/protobuf/empty.pb.h", | |
| 136 "src/google/protobuf/extension_set_heavy.cc", | 170 "src/google/protobuf/extension_set_heavy.cc", |
| 137 "src/google/protobuf/generated_enum_reflection.h", | 171 "src/google/protobuf/extension_set_heavy.h", |
| 172 "src/google/protobuf/field_mask.pb.cc", | |
| 173 "src/google/protobuf/field_mask.pb.h", | |
| 138 "src/google/protobuf/generated_message_reflection.cc", | 174 "src/google/protobuf/generated_message_reflection.cc", |
| 139 "src/google/protobuf/generated_message_reflection.h", | 175 "src/google/protobuf/generated_message_reflection.h", |
| 140 "src/google/protobuf/io/gzip_stream.h", | 176 |
| 177 # "src/google/protobuf/io/gzip_stream.cc", | |
| 178 # "src/google/protobuf/io/gzip_stream.h", | |
|
Peter Kasting
2016/04/06 22:35:40
Add the comment from https://codereview.chromium.o
xyzzyz
2016/04/07 18:55:03
Done.
| |
| 179 "src/google/protobuf/io/printer.cc", | |
| 141 "src/google/protobuf/io/printer.h", | 180 "src/google/protobuf/io/printer.h", |
| 181 "src/google/protobuf/io/strtod.cc", | |
| 182 "src/google/protobuf/io/strtod.h", | |
| 183 "src/google/protobuf/io/tokenizer.cc", | |
| 142 "src/google/protobuf/io/tokenizer.h", | 184 "src/google/protobuf/io/tokenizer.h", |
| 185 "src/google/protobuf/io/zero_copy_stream_impl.cc", | |
| 143 "src/google/protobuf/io/zero_copy_stream_impl.h", | 186 "src/google/protobuf/io/zero_copy_stream_impl.h", |
| 187 "src/google/protobuf/map_field.cc", | |
| 188 "src/google/protobuf/map_field.h", | |
| 144 "src/google/protobuf/message.cc", | 189 "src/google/protobuf/message.cc", |
| 145 "src/google/protobuf/message.h", | 190 "src/google/protobuf/message.h", |
| 146 "src/google/protobuf/reflection_ops.cc", | 191 "src/google/protobuf/reflection_ops.cc", |
| 147 "src/google/protobuf/reflection_ops.h", | 192 "src/google/protobuf/reflection_ops.h", |
| 148 "src/google/protobuf/service.cc", | 193 "src/google/protobuf/service.cc", |
| 149 "src/google/protobuf/service.h", | 194 "src/google/protobuf/service.h", |
| 150 "src/google/protobuf/stubs/stl_util.h", | 195 "src/google/protobuf/source_context.pb.cc", |
| 151 "src/google/protobuf/stubs/stringprintf.cc", | 196 "src/google/protobuf/source_context.pb.h", |
| 152 "src/google/protobuf/stubs/stringprintf.h", | 197 "src/google/protobuf/struct.pb.cc", |
| 153 "src/google/protobuf/stubs/structurally_valid.cc", | 198 "src/google/protobuf/struct.pb.h", |
| 154 "src/google/protobuf/stubs/strutil.cc", | 199 "src/google/protobuf/stubs/mathlimits.cc", |
| 155 "src/google/protobuf/stubs/strutil.h", | 200 "src/google/protobuf/stubs/mathlimits.h", |
| 156 "src/google/protobuf/stubs/substitute.cc", | 201 "src/google/protobuf/stubs/substitute.cc", |
| 157 "src/google/protobuf/stubs/substitute.h", | 202 "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", | 203 "src/google/protobuf/text_format.cc", |
| 161 "src/google/protobuf/text_format.h", | 204 "src/google/protobuf/text_format.h", |
| 205 "src/google/protobuf/timestamp.pb.cc", | |
| 206 "src/google/protobuf/timestamp.pb.h", | |
| 207 "src/google/protobuf/type.pb.cc", | |
| 208 "src/google/protobuf/type.pb.h", | |
| 209 "src/google/protobuf/unknown_field_set.cc", | |
| 210 "src/google/protobuf/unknown_field_set.h", | |
| 211 "src/google/protobuf/util/field_comparator.cc", | |
| 212 "src/google/protobuf/util/field_comparator.h", | |
| 213 "src/google/protobuf/util/field_mask_util.cc", | |
| 214 "src/google/protobuf/util/field_mask_util.h", | |
| 215 "src/google/protobuf/util/internal/datapiece.cc", | |
| 216 "src/google/protobuf/util/internal/datapiece.h", | |
| 217 "src/google/protobuf/util/internal/default_value_objectwriter.cc", | |
| 218 "src/google/protobuf/util/internal/default_value_objectwriter.h", | |
| 219 "src/google/protobuf/util/internal/error_listener.cc", | |
| 220 "src/google/protobuf/util/internal/error_listener.h", | |
| 221 "src/google/protobuf/util/internal/field_mask_utility.cc", | |
| 222 "src/google/protobuf/util/internal/field_mask_utility.h", | |
| 223 "src/google/protobuf/util/internal/json_escaping.cc", | |
| 224 "src/google/protobuf/util/internal/json_escaping.h", | |
| 225 "src/google/protobuf/util/internal/json_objectwriter.cc", | |
| 226 "src/google/protobuf/util/internal/json_objectwriter.h", | |
| 227 "src/google/protobuf/util/internal/json_stream_parser.cc", | |
| 228 "src/google/protobuf/util/internal/json_stream_parser.h", | |
| 229 "src/google/protobuf/util/internal/object_writer.cc", | |
| 230 "src/google/protobuf/util/internal/object_writer.h", | |
| 231 "src/google/protobuf/util/internal/proto_writer.cc", | |
| 232 "src/google/protobuf/util/internal/proto_writer.h", | |
| 233 "src/google/protobuf/util/internal/protostream_objectsource.cc", | |
| 234 "src/google/protobuf/util/internal/protostream_objectsource.h", | |
| 235 "src/google/protobuf/util/internal/protostream_objectwriter.cc", | |
| 236 "src/google/protobuf/util/internal/protostream_objectwriter.h", | |
| 237 "src/google/protobuf/util/internal/type_info.cc", | |
| 238 "src/google/protobuf/util/internal/type_info.h", | |
| 239 "src/google/protobuf/util/internal/type_info_test_helper.cc", | |
| 240 "src/google/protobuf/util/internal/type_info_test_helper.h", | |
| 241 "src/google/protobuf/util/internal/utility.cc", | |
| 242 "src/google/protobuf/util/internal/utility.h", | |
| 243 "src/google/protobuf/util/json_util.cc", | |
| 244 "src/google/protobuf/util/json_util.h", | |
| 245 "src/google/protobuf/util/message_differencer.cc", | |
| 246 "src/google/protobuf/util/message_differencer.h", | |
| 247 "src/google/protobuf/util/time_util.cc", | |
| 248 "src/google/protobuf/util/time_util.h", | |
| 249 "src/google/protobuf/util/type_resolver_util.cc", | |
| 250 "src/google/protobuf/util/type_resolver_util.h", | |
| 162 "src/google/protobuf/wire_format.cc", | 251 "src/google/protobuf/wire_format.cc", |
| 163 "src/google/protobuf/wire_format.h", | 252 "src/google/protobuf/wire_format.h", |
| 164 | 253 "src/google/protobuf/wrappers.pb.cc", |
| 165 # This file pulls in zlib, but it's not actually used by protoc, so | 254 "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 ] | 255 ] |
| 174 | 256 |
| 175 configs -= [ "//build/config/compiler:chromium_code" ] | 257 configs -= [ "//build/config/compiler:chromium_code" ] |
| 176 configs += [ "//build/config/compiler:no_chromium_code" ] | 258 configs += [ |
| 259 "//build/config/compiler:no_chromium_code", | |
| 260 | |
| 261 # Must be after no_chromium_code for warning flags to be ordered | |
| 262 # correctly. | |
| 263 ":protobuf_warnings", | |
| 264 ] | |
| 177 if (is_win) { | 265 if (is_win) { |
| 178 configs -= [ "//build/config/win:lean_and_mean" ] | 266 configs -= [ "//build/config/win:lean_and_mean" ] |
| 179 } | 267 } |
| 180 public_configs = [ | 268 public_configs = [ |
| 181 ":protobuf_config", | 269 ":protobuf_config", |
| 182 | 270 |
| 183 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 271 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 184 "//build/config/compiler:no_size_t_to_int_warning", | 272 "//build/config/compiler:no_size_t_to_int_warning", |
| 185 ] | 273 ] |
| 186 | 274 |
| 187 cflags = protobuf_lite_cflags | 275 cflags = protobuf_lite_cflags |
| 188 } | 276 } |
| 189 | 277 |
| 190 # Only compile the compiler for the host architecture. | 278 # Only compile the compiler for the host architecture. |
| 191 if (current_toolchain == host_toolchain) { | 279 if (current_toolchain == host_toolchain) { |
| 192 executable("protoc") { | 280 executable("protoc") { |
| 193 sources = [ | 281 sources = [ |
| 194 "src/google/protobuf/compiler/code_generator.cc", | 282 "src/google/protobuf/compiler/code_generator.cc", |
| 283 "src/google/protobuf/compiler/code_generator.h", | |
| 195 "src/google/protobuf/compiler/command_line_interface.cc", | 284 "src/google/protobuf/compiler/command_line_interface.cc", |
| 285 "src/google/protobuf/compiler/command_line_interface.h", | |
| 196 "src/google/protobuf/compiler/cpp/cpp_enum.cc", | 286 "src/google/protobuf/compiler/cpp/cpp_enum.cc", |
| 197 "src/google/protobuf/compiler/cpp/cpp_enum.h", | 287 "src/google/protobuf/compiler/cpp/cpp_enum.h", |
| 198 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", | 288 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", |
| 199 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", | 289 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", |
| 200 "src/google/protobuf/compiler/cpp/cpp_extension.cc", | 290 "src/google/protobuf/compiler/cpp/cpp_extension.cc", |
| 201 "src/google/protobuf/compiler/cpp/cpp_extension.h", | 291 "src/google/protobuf/compiler/cpp/cpp_extension.h", |
| 202 "src/google/protobuf/compiler/cpp/cpp_field.cc", | 292 "src/google/protobuf/compiler/cpp/cpp_field.cc", |
| 203 "src/google/protobuf/compiler/cpp/cpp_field.h", | 293 "src/google/protobuf/compiler/cpp/cpp_field.h", |
| 204 "src/google/protobuf/compiler/cpp/cpp_file.cc", | 294 "src/google/protobuf/compiler/cpp/cpp_file.cc", |
| 205 "src/google/protobuf/compiler/cpp/cpp_file.h", | 295 "src/google/protobuf/compiler/cpp/cpp_file.h", |
| 206 "src/google/protobuf/compiler/cpp/cpp_generator.cc", | 296 "src/google/protobuf/compiler/cpp/cpp_generator.cc", |
| 297 "src/google/protobuf/compiler/cpp/cpp_generator.h", | |
| 207 "src/google/protobuf/compiler/cpp/cpp_helpers.cc", | 298 "src/google/protobuf/compiler/cpp/cpp_helpers.cc", |
| 208 "src/google/protobuf/compiler/cpp/cpp_helpers.h", | 299 "src/google/protobuf/compiler/cpp/cpp_helpers.h", |
| 300 "src/google/protobuf/compiler/cpp/cpp_map_field.cc", | |
| 301 "src/google/protobuf/compiler/cpp/cpp_map_field.h", | |
| 209 "src/google/protobuf/compiler/cpp/cpp_message.cc", | 302 "src/google/protobuf/compiler/cpp/cpp_message.cc", |
| 210 "src/google/protobuf/compiler/cpp/cpp_message.h", | 303 "src/google/protobuf/compiler/cpp/cpp_message.h", |
| 211 "src/google/protobuf/compiler/cpp/cpp_message_field.cc", | 304 "src/google/protobuf/compiler/cpp/cpp_message_field.cc", |
| 212 "src/google/protobuf/compiler/cpp/cpp_message_field.h", | 305 "src/google/protobuf/compiler/cpp/cpp_message_field.h", |
| 213 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", | 306 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", |
| 214 "src/google/protobuf/compiler/cpp/cpp_primitive_field.h", | 307 "src/google/protobuf/compiler/cpp/cpp_primitive_field.h", |
| 215 "src/google/protobuf/compiler/cpp/cpp_service.cc", | 308 "src/google/protobuf/compiler/cpp/cpp_service.cc", |
| 216 "src/google/protobuf/compiler/cpp/cpp_service.h", | 309 "src/google/protobuf/compiler/cpp/cpp_service.h", |
| 217 "src/google/protobuf/compiler/cpp/cpp_string_field.cc", | 310 "src/google/protobuf/compiler/cpp/cpp_string_field.cc", |
| 218 "src/google/protobuf/compiler/cpp/cpp_string_field.h", | 311 "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", | 312 "src/google/protobuf/compiler/main.cc", |
| 243 "src/google/protobuf/compiler/plugin.cc", | 313 "src/google/protobuf/compiler/plugin.cc", |
| 314 "src/google/protobuf/compiler/plugin.h", | |
| 244 "src/google/protobuf/compiler/plugin.pb.cc", | 315 "src/google/protobuf/compiler/plugin.pb.cc", |
| 316 "src/google/protobuf/compiler/plugin.pb.h", | |
| 245 "src/google/protobuf/compiler/python/python_generator.cc", | 317 "src/google/protobuf/compiler/python/python_generator.cc", |
| 318 "src/google/protobuf/compiler/python/python_generator.h", | |
| 246 "src/google/protobuf/compiler/subprocess.cc", | 319 "src/google/protobuf/compiler/subprocess.cc", |
| 247 "src/google/protobuf/compiler/subprocess.h", | 320 "src/google/protobuf/compiler/subprocess.h", |
| 248 "src/google/protobuf/compiler/zip_writer.cc", | 321 "src/google/protobuf/compiler/zip_writer.cc", |
| 249 "src/google/protobuf/compiler/zip_writer.h", | 322 "src/google/protobuf/compiler/zip_writer.h", |
| 250 ] | 323 ] |
| 251 | 324 |
| 252 configs -= [ "//build/config/compiler:chromium_code" ] | 325 configs -= [ "//build/config/compiler:chromium_code" ] |
| 253 configs += [ "//build/config/compiler:no_chromium_code" ] | 326 configs += [ |
| 327 "//build/config/compiler:no_chromium_code", | |
| 328 | |
| 329 # Must be after no_chromium_code for warning flags to be ordered | |
| 330 # correctly. | |
| 331 ":protobuf_warnings", | |
| 332 ] | |
| 254 if (is_win) { | 333 if (is_win) { |
| 255 # This is defined internally, don't warn on duplicate. | 334 # This is defined internally, don't warn on duplicate. |
| 256 configs -= [ "//build/config/win:lean_and_mean" ] | 335 configs -= [ "//build/config/win:lean_and_mean" ] |
| 257 } | 336 } |
| 258 | 337 |
| 259 cflags = protobuf_lite_cflags | 338 cflags = protobuf_lite_cflags |
| 260 | 339 |
| 261 deps = [ | 340 deps = [ |
| 262 ":protobuf_full", | 341 ":protobuf_full", |
| 263 "//build/config/sanitizers:deps", | 342 "//build/config/sanitizers:deps", |
| 264 ] | 343 ] |
| 265 deps += [ "//build/config/sanitizers:deps" ] | 344 deps += [ "//build/config/sanitizers:deps" ] |
| 266 } | 345 } |
| 267 } | 346 } |
| 268 | 347 |
| 269 google_python_dir = "$root_out_dir/pyproto/google" | 348 google_python_dir = "$root_out_dir/pyproto/google" |
| 270 | 349 |
| 271 copy("copy_google") { | 350 copy("copy_google") { |
| 272 sources = [ | 351 sources = [ |
| 273 "__init__.py", | 352 "__init__.py", |
|
Peter Kasting
2016/04/06 22:35:39
Copy location needs to be updated, see comments in
xyzzyz
2016/04/07 18:55:03
See my response there.
| |
| 274 ] | 353 ] |
| 275 outputs = [ | 354 outputs = [ |
| 276 "$google_python_dir/{{source_file_part}}", | 355 "$google_python_dir/{{source_file_part}}", |
| 277 ] | 356 ] |
| 278 } | 357 } |
| 279 | 358 |
| 359 copy("copy_six") { | |
| 360 sources = [ | |
| 361 "third_party/six/six.py", | |
| 362 ] | |
| 363 outputs = [ | |
| 364 "$google_python_dir/third_party/six/{{source_file_part}}", | |
| 365 ] | |
| 366 } | |
| 367 | |
| 280 copy("copy_google_protobuf") { | 368 copy("copy_google_protobuf") { |
| 281 sources = [ | 369 sources = [ |
| 282 "python/google/protobuf/__init__.py", | 370 "python/google/protobuf/__init__.py", |
| 283 "python/google/protobuf/descriptor.py", | 371 "python/google/protobuf/descriptor.py", |
| 284 "python/google/protobuf/descriptor_database.py", | 372 "python/google/protobuf/descriptor_database.py", |
| 285 "python/google/protobuf/descriptor_pool.py", | 373 "python/google/protobuf/descriptor_pool.py", |
| 374 "python/google/protobuf/json_format.py", | |
| 286 "python/google/protobuf/message.py", | 375 "python/google/protobuf/message.py", |
| 287 "python/google/protobuf/message_factory.py", | 376 "python/google/protobuf/message_factory.py", |
| 377 "python/google/protobuf/proto_builder.py", | |
| 288 "python/google/protobuf/reflection.py", | 378 "python/google/protobuf/reflection.py", |
| 289 "python/google/protobuf/service.py", | 379 "python/google/protobuf/service.py", |
| 290 "python/google/protobuf/service_reflection.py", | 380 "python/google/protobuf/service_reflection.py", |
| 381 "python/google/protobuf/symbol_database.py", | |
| 382 "python/google/protobuf/text_encoding.py", | |
| 291 "python/google/protobuf/text_format.py", | 383 "python/google/protobuf/text_format.py", |
| 292 | 384 |
| 293 # TODO(ncarter): protoc"s python generator treats | 385 # TODO(ncarter): protoc"s python generator treats |
| 294 # descriptor.proto specially, but it's not possible to trigger | 386 # descriptor.proto specially, but it's not possible to trigger |
| 295 # the special treatment unless you run protoc from ./src/src | 387 # the special treatment unless you run protoc from ./src/src |
| 296 # (the treatment is based on the path to the .proto file | 388 # (the treatment is based on the path to the .proto file |
| 297 # matching a constant exactly). I'm not sure how to convince | 389 # matching a constant exactly). I'm not sure how to convince |
| 298 # gyp to execute a rule from a different directory. Until this | 390 # gyp to execute a rule from a different directory. Until this |
| 299 # is resolved, use a copy of descriptor_pb2.py that I manually | 391 # is resolved, use a copy of descriptor_pb2.py that I manually |
| 300 # generated. | 392 # generated. |
| 301 "descriptor_pb2.py", | 393 "descriptor_pb2.py", |
|
Peter Kasting
2016/04/06 22:35:39
You should move this into python/google/protobuf/
xyzzyz
2016/04/07 18:55:03
Done.
| |
| 302 ] | 394 ] |
| 303 outputs = [ | 395 outputs = [ |
| 304 "$google_python_dir/protobuf/{{source_file_part}}", | 396 "$google_python_dir/protobuf/{{source_file_part}}", |
| 305 ] | 397 ] |
| 306 } | 398 } |
| 307 | 399 |
| 308 copy("copy_google_protobuf_internal") { | 400 copy("copy_google_protobuf_internal") { |
| 309 sources = [ | 401 sources = [ |
| 310 "python/google/protobuf/internal/__init__.py", | 402 "python/google/protobuf/internal/__init__.py", |
| 403 "python/google/protobuf/internal/_parameterized.py", | |
| 311 "python/google/protobuf/internal/api_implementation.py", | 404 "python/google/protobuf/internal/api_implementation.py", |
| 312 "python/google/protobuf/internal/containers.py", | 405 "python/google/protobuf/internal/containers.py", |
| 313 "python/google/protobuf/internal/cpp_message.py", | |
| 314 "python/google/protobuf/internal/decoder.py", | 406 "python/google/protobuf/internal/decoder.py", |
| 315 "python/google/protobuf/internal/encoder.py", | 407 "python/google/protobuf/internal/encoder.py", |
| 316 "python/google/protobuf/internal/enum_type_wrapper.py", | 408 "python/google/protobuf/internal/enum_type_wrapper.py", |
| 317 "python/google/protobuf/internal/generator_test.py", | |
| 318 "python/google/protobuf/internal/message_listener.py", | 409 "python/google/protobuf/internal/message_listener.py", |
| 319 "python/google/protobuf/internal/python_message.py", | 410 "python/google/protobuf/internal/python_message.py", |
| 320 "python/google/protobuf/internal/type_checkers.py", | 411 "python/google/protobuf/internal/type_checkers.py", |
| 412 "python/google/protobuf/internal/well_known_types.py", | |
| 321 "python/google/protobuf/internal/wire_format.py", | 413 "python/google/protobuf/internal/wire_format.py", |
| 322 ] | 414 ] |
| 323 outputs = [ | 415 outputs = [ |
| 324 "$google_python_dir/protobuf/internal/{{source_file_part}}", | 416 "$google_python_dir/protobuf/internal/{{source_file_part}}", |
| 325 ] | 417 ] |
| 326 } | 418 } |
| 327 | 419 |
| 328 group("py_proto") { | 420 group("py_proto") { |
| 329 public_deps = [ | 421 public_deps = [ |
| 330 ":copy_google", | 422 ":copy_google", |
| 331 ":copy_google_protobuf", | 423 ":copy_google_protobuf", |
| 332 ":copy_google_protobuf_internal", | 424 ":copy_google_protobuf_internal", |
| 425 ":copy_six", | |
| 333 ] | 426 ] |
| 334 | 427 |
| 335 # Targets that depend on this should depend on the copied data files. | 428 # Targets that depend on this should depend on the copied data files. |
| 336 data = get_target_outputs(":copy_google") | 429 data = get_target_outputs(":copy_google") |
| 430 data += get_target_outputs(":copy_six") | |
| 337 data += get_target_outputs(":copy_google_protobuf") | 431 data += get_target_outputs(":copy_google_protobuf") |
| 338 data += get_target_outputs(":copy_google_protobuf_internal") | 432 data += get_target_outputs(":copy_google_protobuf_internal") |
| 339 } | 433 } |
| OLD | NEW |