Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/protobuf/BUILD.gn

Issue 1842653006: Update //third_party/protobuf to version 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/protobuf/BUILD ('k') | third_party/protobuf/CHANGES.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 = [
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", 50 "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",
55 "src/google/protobuf/map.h",
56 "src/google/protobuf/map_entry_lite.h",
57 "src/google/protobuf/map_field_lite.h",
58 "src/google/protobuf/map_type_handler.h",
49 "src/google/protobuf/message_lite.cc", 59 "src/google/protobuf/message_lite.cc",
50 "src/google/protobuf/message_lite.h", 60 "src/google/protobuf/message_lite.h",
51 "src/google/protobuf/repeated_field.cc", 61 "src/google/protobuf/repeated_field.cc",
52 "src/google/protobuf/repeated_field.h", 62 "src/google/protobuf/repeated_field.h",
53 "src/google/protobuf/stubs/atomicops.h", 63 "src/google/protobuf/stubs/atomicops.h",
64 "src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h",
54 "src/google/protobuf/stubs/atomicops_internals_arm_gcc.h", 65 "src/google/protobuf/stubs/atomicops_internals_arm_gcc.h",
66 "src/google/protobuf/stubs/atomicops_internals_arm_qnx.h",
55 "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h", 67 "src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h",
68 "src/google/protobuf/stubs/atomicops_internals_generic_gcc.h",
56 "src/google/protobuf/stubs/atomicops_internals_macosx.h", 69 "src/google/protobuf/stubs/atomicops_internals_macosx.h",
57 "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h", 70 "src/google/protobuf/stubs/atomicops_internals_mips_gcc.h",
71 "src/google/protobuf/stubs/atomicops_internals_pnacl.h",
72 "src/google/protobuf/stubs/atomicops_internals_power.h",
73 "src/google/protobuf/stubs/atomicops_internals_solaris.h",
74 "src/google/protobuf/stubs/atomicops_internals_tsan.h",
58 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", 75 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
59 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h", 76 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h",
60 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", 77 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
61 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h", 78 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h",
79 "src/google/protobuf/stubs/atomic_sequence_num.h",
80 "src/google/protobuf/stubs/bytestream.cc",
81 "src/google/protobuf/stubs/bytestream.h",
82 "src/google/protobuf/stubs/callback.h",
83 "src/google/protobuf/stubs/casts.h",
62 "src/google/protobuf/stubs/common.cc", 84 "src/google/protobuf/stubs/common.cc",
63 "src/google/protobuf/stubs/common.h", 85 "src/google/protobuf/stubs/common.h",
86 "src/google/protobuf/stubs/fastmem.h",
64 "src/google/protobuf/stubs/hash.h", 87 "src/google/protobuf/stubs/hash.h",
65 "src/google/protobuf/stubs/map-util.h", 88 "src/google/protobuf/stubs/int128.cc",
89 "src/google/protobuf/stubs/int128.h",
90 "src/google/protobuf/stubs/logging.h",
91 "src/google/protobuf/stubs/macros.h",
92 "src/google/protobuf/stubs/map_util.h",
93 "src/google/protobuf/stubs/mutex.h",
66 "src/google/protobuf/stubs/once.cc", 94 "src/google/protobuf/stubs/once.cc",
67 "src/google/protobuf/stubs/once.h", 95 "src/google/protobuf/stubs/once.h",
68 "src/google/protobuf/stubs/platform_macros.h", 96 "src/google/protobuf/stubs/platform_macros.h",
69 "src/google/protobuf/unknown_field_set.cc", 97 "src/google/protobuf/stubs/port.h",
70 "src/google/protobuf/unknown_field_set.h", 98 "src/google/protobuf/stubs/scoped_ptr.h",
99 "src/google/protobuf/stubs/shared_ptr.h",
100 "src/google/protobuf/stubs/status.cc",
101 "src/google/protobuf/stubs/status.h",
102 "src/google/protobuf/stubs/status_macros.h",
103 "src/google/protobuf/stubs/statusor.cc",
104 "src/google/protobuf/stubs/statusor.h",
105 "src/google/protobuf/stubs/stl_util.h",
106 "src/google/protobuf/stubs/stringpiece.cc",
107 "src/google/protobuf/stubs/stringpiece.h",
108 "src/google/protobuf/stubs/stringprintf.cc",
109 "src/google/protobuf/stubs/stringprintf.h",
110 "src/google/protobuf/stubs/structurally_valid.cc",
111 "src/google/protobuf/stubs/strutil.cc",
112 "src/google/protobuf/stubs/strutil.h",
113 "src/google/protobuf/stubs/template_util.h",
114 "src/google/protobuf/stubs/type_traits.h",
115 "src/google/protobuf/stubs/time.cc",
116 "src/google/protobuf/stubs/time.h",
71 "src/google/protobuf/wire_format_lite.cc", 117 "src/google/protobuf/wire_format_lite.cc",
72 "src/google/protobuf/wire_format_lite.h", 118 "src/google/protobuf/wire_format_lite.h",
73 "src/google/protobuf/wire_format_lite_inl.h", 119 "src/google/protobuf/wire_format_lite_inl.h",
74 "$config_h_dir/config.h",
75 ] 120 ]
76 121
77 protobuf_lite_cflags = [] 122 protobuf_lite_cflags = []
78 if (is_win) { 123 if (is_win) {
79 protobuf_lite_cflags = [ 124 protobuf_lite_cflags = [
80 "/wd4018", # Signed/unsigned mismatch in comparison. 125 "/wd4018", # signed/unsigned mismatch in comparison
81 "/wd4244", # Implicit conversion, possible loss of data. 126 "/wd4065", # switch statement contains 'default' but no 'case' labels
82 "/wd4355", # 'this' used in base member initializer list. 127 "/wd4146", # unary minus operator applied to unsigned type
83 "/wd4267", # Size_t to int truncation. 128 "/wd4244", # implicit conversion, possible loss of data
84 "/wd4291", # No matching operator delete for a placement new. 129 "/wd4267", # size_t to int truncation
130 "/wd4291", # no matching operator delete for a placement new.
131 "/wd4305", # double to float truncation
132 "/wd4355", # 'this' used in base member initializer list
133 "/wd4506", # no definition for inline function (protobuf issue #240)
85 ] 134 ]
86 } 135 }
87 136
88 component("protobuf_lite") { 137 component("protobuf_lite") {
89 sources = protobuf_lite_sources 138 sources = protobuf_lite_sources
90 139
91 configs -= [ "//build/config/compiler:chromium_code" ] 140 configs -= [ "//build/config/compiler:chromium_code" ]
92 configs += [ "//build/config/compiler:no_chromium_code" ] 141 configs += [
142 "//build/config/compiler:no_chromium_code",
143
144 # Must be after no_chromium_code for warning flags to be ordered
145 # correctly.
146 ":protobuf_warnings",
147 ]
148
93 if (is_win) { 149 if (is_win) {
94 configs -= [ "//build/config/win:lean_and_mean" ] 150 configs -= [ "//build/config/win:lean_and_mean" ]
95 } 151 }
152
96 public_configs = [ 153 public_configs = [
97 ":protobuf_config", 154 ":protobuf_config",
98 155
99 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 156 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
100 "//build/config/compiler:no_size_t_to_int_warning", 157 "//build/config/compiler:no_size_t_to_int_warning",
101 ] 158 ]
102 159
160 deps = [
161 "//build/config/sanitizers:deps",
162 ]
163
103 cflags = protobuf_lite_cflags 164 cflags = protobuf_lite_cflags
104 165
105 # Required for component builds. See http://crbug.com/172800. 166 # Required for component builds. See http://crbug.com/172800.
106 if (is_component_build) { 167 if (is_component_build) {
107 public_configs += [ ":protobuf_use_dlls" ] 168 public_configs += [ ":protobuf_use_dlls" ]
108 defines = [ "LIBPROTOBUF_EXPORTS" ] 169 defines = [ "LIBPROTOBUF_EXPORTS" ]
109 } 170 }
110 } 171 }
111 172
112 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't 173 # 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 174 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls
114 # into that category. Do not use in Chrome code. 175 # into that category. Do not use in Chrome code.
115
116 source_set("protobuf_full") { 176 source_set("protobuf_full") {
117 # Prevent people from depending on this outside our file. 177 # Prevent people from depending on this outside our file.
118 visibility = [ ":*" ] 178 visibility = [ ":*" ]
119 179
120 sources = protobuf_lite_sources 180 sources = protobuf_lite_sources
121 sources += [ 181 sources += [
122 "src/google/protobuf/compiler/code_generator.h", 182 "src/google/protobuf/any.cc",
123 "src/google/protobuf/compiler/command_line_interface.h", 183 "src/google/protobuf/any.h",
184 "src/google/protobuf/any.pb.cc",
185 "src/google/protobuf/any.pb.h",
186 "src/google/protobuf/api.pb.cc",
187 "src/google/protobuf/api.pb.h",
188 "src/google/protobuf/compiler/importer.cc",
124 "src/google/protobuf/compiler/importer.h", 189 "src/google/protobuf/compiler/importer.h",
125 "src/google/protobuf/compiler/java/java_doc_comment.cc", 190 "src/google/protobuf/compiler/parser.cc",
126 "src/google/protobuf/compiler/java/java_doc_comment.h",
127 "src/google/protobuf/compiler/parser.h", 191 "src/google/protobuf/compiler/parser.h",
128 "src/google/protobuf/descriptor.cc", 192 "src/google/protobuf/descriptor.cc",
129 "src/google/protobuf/descriptor.h", 193 "src/google/protobuf/descriptor.h",
130 "src/google/protobuf/descriptor.pb.cc", 194 "src/google/protobuf/descriptor.pb.cc",
131 "src/google/protobuf/descriptor.pb.h", 195 "src/google/protobuf/descriptor.pb.h",
132 "src/google/protobuf/descriptor_database.cc", 196 "src/google/protobuf/descriptor_database.cc",
133 "src/google/protobuf/descriptor_database.h", 197 "src/google/protobuf/descriptor_database.h",
198 "src/google/protobuf/duration.pb.cc",
199 "src/google/protobuf/duration.pb.h",
134 "src/google/protobuf/dynamic_message.cc", 200 "src/google/protobuf/dynamic_message.cc",
135 "src/google/protobuf/dynamic_message.h", 201 "src/google/protobuf/dynamic_message.h",
202 "src/google/protobuf/empty.pb.cc",
203 "src/google/protobuf/empty.pb.h",
136 "src/google/protobuf/extension_set_heavy.cc", 204 "src/google/protobuf/extension_set_heavy.cc",
205 "src/google/protobuf/field_mask.pb.cc",
206 "src/google/protobuf/field_mask.pb.h",
137 "src/google/protobuf/generated_enum_reflection.h", 207 "src/google/protobuf/generated_enum_reflection.h",
208 "src/google/protobuf/generated_enum_util.h",
138 "src/google/protobuf/generated_message_reflection.cc", 209 "src/google/protobuf/generated_message_reflection.cc",
139 "src/google/protobuf/generated_message_reflection.h", 210 "src/google/protobuf/generated_message_reflection.h",
140 "src/google/protobuf/io/gzip_stream.h", 211
212 # gzip_stream.cc pulls in zlib, but it's not actually used by protoc, just
213 # by test code, so instead of compiling zlib for the host, let's just
214 # exclude this.
215 # "src/google/protobuf/io/gzip_stream.cc",
216 # "src/google/protobuf/io/gzip_stream.h",
217
218 "src/google/protobuf/io/printer.cc",
141 "src/google/protobuf/io/printer.h", 219 "src/google/protobuf/io/printer.h",
220 "src/google/protobuf/io/strtod.cc",
221 "src/google/protobuf/io/strtod.h",
222 "src/google/protobuf/io/tokenizer.cc",
142 "src/google/protobuf/io/tokenizer.h", 223 "src/google/protobuf/io/tokenizer.h",
224 "src/google/protobuf/io/zero_copy_stream_impl.cc",
143 "src/google/protobuf/io/zero_copy_stream_impl.h", 225 "src/google/protobuf/io/zero_copy_stream_impl.h",
226 "src/google/protobuf/map_entry.h",
227 "src/google/protobuf/map_field.cc",
228 "src/google/protobuf/map_field.h",
229 "src/google/protobuf/map_field_inl.h",
144 "src/google/protobuf/message.cc", 230 "src/google/protobuf/message.cc",
145 "src/google/protobuf/message.h", 231 "src/google/protobuf/message.h",
232 "src/google/protobuf/metadata.h",
233 "src/google/protobuf/reflection.h",
234 "src/google/protobuf/reflection_internal.h",
146 "src/google/protobuf/reflection_ops.cc", 235 "src/google/protobuf/reflection_ops.cc",
147 "src/google/protobuf/reflection_ops.h", 236 "src/google/protobuf/reflection_ops.h",
148 "src/google/protobuf/service.cc", 237 "src/google/protobuf/service.cc",
149 "src/google/protobuf/service.h", 238 "src/google/protobuf/service.h",
150 "src/google/protobuf/stubs/stl_util.h", 239 "src/google/protobuf/source_context.pb.cc",
151 "src/google/protobuf/stubs/stringprintf.cc", 240 "src/google/protobuf/source_context.pb.h",
152 "src/google/protobuf/stubs/stringprintf.h", 241 "src/google/protobuf/struct.pb.cc",
153 "src/google/protobuf/stubs/structurally_valid.cc", 242 "src/google/protobuf/struct.pb.h",
154 "src/google/protobuf/stubs/strutil.cc", 243 "src/google/protobuf/stubs/mathlimits.cc",
155 "src/google/protobuf/stubs/strutil.h", 244 "src/google/protobuf/stubs/mathlimits.h",
245 "src/google/protobuf/stubs/mathutil.h",
246 "src/google/protobuf/stubs/singleton.h",
156 "src/google/protobuf/stubs/substitute.cc", 247 "src/google/protobuf/stubs/substitute.cc",
157 "src/google/protobuf/stubs/substitute.h", 248 "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", 249 "src/google/protobuf/text_format.cc",
161 "src/google/protobuf/text_format.h", 250 "src/google/protobuf/text_format.h",
251 "src/google/protobuf/timestamp.pb.cc",
252 "src/google/protobuf/timestamp.pb.h",
253 "src/google/protobuf/type.pb.cc",
254 "src/google/protobuf/type.pb.h",
255 "src/google/protobuf/unknown_field_set.cc",
256 "src/google/protobuf/unknown_field_set.h",
257 "src/google/protobuf/util/field_comparator.cc",
258 "src/google/protobuf/util/field_comparator.h",
259 "src/google/protobuf/util/field_mask_util.cc",
260 "src/google/protobuf/util/field_mask_util.h",
261 "src/google/protobuf/util/internal/constants.h",
262 "src/google/protobuf/util/internal/datapiece.cc",
263 "src/google/protobuf/util/internal/datapiece.h",
264 "src/google/protobuf/util/internal/default_value_objectwriter.cc",
265 "src/google/protobuf/util/internal/default_value_objectwriter.h",
266 "src/google/protobuf/util/internal/error_listener.cc",
267 "src/google/protobuf/util/internal/error_listener.h",
268 "src/google/protobuf/util/internal/field_mask_utility.cc",
269 "src/google/protobuf/util/internal/field_mask_utility.h",
270 "src/google/protobuf/util/internal/json_escaping.cc",
271 "src/google/protobuf/util/internal/json_escaping.h",
272 "src/google/protobuf/util/internal/json_objectwriter.cc",
273 "src/google/protobuf/util/internal/json_objectwriter.h",
274 "src/google/protobuf/util/internal/json_stream_parser.cc",
275 "src/google/protobuf/util/internal/json_stream_parser.h",
276 "src/google/protobuf/util/internal/location_tracker.h",
277 "src/google/protobuf/util/internal/object_location_tracker.h",
278 "src/google/protobuf/util/internal/object_source.h",
279 "src/google/protobuf/util/internal/object_writer.cc",
280 "src/google/protobuf/util/internal/object_writer.h",
281 "src/google/protobuf/util/internal/proto_writer.cc",
282 "src/google/protobuf/util/internal/proto_writer.h",
283 "src/google/protobuf/util/internal/protostream_objectsource.cc",
284 "src/google/protobuf/util/internal/protostream_objectsource.h",
285 "src/google/protobuf/util/internal/protostream_objectwriter.cc",
286 "src/google/protobuf/util/internal/protostream_objectwriter.h",
287 "src/google/protobuf/util/internal/structured_object_writer.h",
288 "src/google/protobuf/util/internal/type_info.cc",
289 "src/google/protobuf/util/internal/type_info.h",
290 "src/google/protobuf/util/internal/type_info_test_helper.cc",
291 "src/google/protobuf/util/internal/type_info_test_helper.h",
292 "src/google/protobuf/util/internal/utility.cc",
293 "src/google/protobuf/util/internal/utility.h",
294 "src/google/protobuf/util/json_util.cc",
295 "src/google/protobuf/util/json_util.h",
296 "src/google/protobuf/util/message_differencer.cc",
297 "src/google/protobuf/util/message_differencer.h",
298 "src/google/protobuf/util/time_util.cc",
299 "src/google/protobuf/util/time_util.h",
300 "src/google/protobuf/util/type_resolver.h",
301 "src/google/protobuf/util/type_resolver_util.cc",
302 "src/google/protobuf/util/type_resolver_util.h",
162 "src/google/protobuf/wire_format.cc", 303 "src/google/protobuf/wire_format.cc",
163 "src/google/protobuf/wire_format.h", 304 "src/google/protobuf/wire_format.h",
164 305 "src/google/protobuf/wrappers.pb.cc",
165 # This file pulls in zlib, but it's not actually used by protoc, so 306 "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 ] 307 ]
174 308
175 configs -= [ "//build/config/compiler:chromium_code" ] 309 configs -= [ "//build/config/compiler:chromium_code" ]
176 configs += [ "//build/config/compiler:no_chromium_code" ] 310 configs += [
311 "//build/config/compiler:no_chromium_code",
312
313 # Must be after no_chromium_code for warning flags to be ordered
314 # correctly.
315 ":protobuf_warnings",
316 ]
177 if (is_win) { 317 if (is_win) {
178 configs -= [ "//build/config/win:lean_and_mean" ] 318 configs -= [ "//build/config/win:lean_and_mean" ]
179 } 319 }
180 public_configs = [ 320 public_configs = [
181 ":protobuf_config", 321 ":protobuf_config",
182 322
183 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 323 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
184 "//build/config/compiler:no_size_t_to_int_warning", 324 "//build/config/compiler:no_size_t_to_int_warning",
185 ] 325 ]
186 326
187 cflags = protobuf_lite_cflags 327 cflags = protobuf_lite_cflags
188 } 328 }
189 329
190 # Only compile the compiler for the host architecture. 330 # Only compile the compiler for the host architecture.
191 if (current_toolchain == host_toolchain) { 331 if (current_toolchain == host_toolchain) {
192 executable("protoc") { 332 executable("protoc") {
193 sources = [ 333 sources = [
194 "src/google/protobuf/compiler/code_generator.cc", 334 "src/google/protobuf/compiler/code_generator.cc",
335 "src/google/protobuf/compiler/code_generator.h",
195 "src/google/protobuf/compiler/command_line_interface.cc", 336 "src/google/protobuf/compiler/command_line_interface.cc",
337 "src/google/protobuf/compiler/command_line_interface.h",
196 "src/google/protobuf/compiler/cpp/cpp_enum.cc", 338 "src/google/protobuf/compiler/cpp/cpp_enum.cc",
197 "src/google/protobuf/compiler/cpp/cpp_enum.h", 339 "src/google/protobuf/compiler/cpp/cpp_enum.h",
198 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", 340 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
199 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", 341 "src/google/protobuf/compiler/cpp/cpp_enum_field.h",
200 "src/google/protobuf/compiler/cpp/cpp_extension.cc", 342 "src/google/protobuf/compiler/cpp/cpp_extension.cc",
201 "src/google/protobuf/compiler/cpp/cpp_extension.h", 343 "src/google/protobuf/compiler/cpp/cpp_extension.h",
202 "src/google/protobuf/compiler/cpp/cpp_field.cc", 344 "src/google/protobuf/compiler/cpp/cpp_field.cc",
203 "src/google/protobuf/compiler/cpp/cpp_field.h", 345 "src/google/protobuf/compiler/cpp/cpp_field.h",
204 "src/google/protobuf/compiler/cpp/cpp_file.cc", 346 "src/google/protobuf/compiler/cpp/cpp_file.cc",
205 "src/google/protobuf/compiler/cpp/cpp_file.h", 347 "src/google/protobuf/compiler/cpp/cpp_file.h",
206 "src/google/protobuf/compiler/cpp/cpp_generator.cc", 348 "src/google/protobuf/compiler/cpp/cpp_generator.cc",
349 "src/google/protobuf/compiler/cpp/cpp_generator.h",
207 "src/google/protobuf/compiler/cpp/cpp_helpers.cc", 350 "src/google/protobuf/compiler/cpp/cpp_helpers.cc",
208 "src/google/protobuf/compiler/cpp/cpp_helpers.h", 351 "src/google/protobuf/compiler/cpp/cpp_helpers.h",
352 "src/google/protobuf/compiler/cpp/cpp_map_field.cc",
353 "src/google/protobuf/compiler/cpp/cpp_map_field.h",
209 "src/google/protobuf/compiler/cpp/cpp_message.cc", 354 "src/google/protobuf/compiler/cpp/cpp_message.cc",
210 "src/google/protobuf/compiler/cpp/cpp_message.h", 355 "src/google/protobuf/compiler/cpp/cpp_message.h",
211 "src/google/protobuf/compiler/cpp/cpp_message_field.cc", 356 "src/google/protobuf/compiler/cpp/cpp_message_field.cc",
212 "src/google/protobuf/compiler/cpp/cpp_message_field.h", 357 "src/google/protobuf/compiler/cpp/cpp_message_field.h",
358 "src/google/protobuf/compiler/cpp/cpp_options.h",
213 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", 359 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
214 "src/google/protobuf/compiler/cpp/cpp_primitive_field.h", 360 "src/google/protobuf/compiler/cpp/cpp_primitive_field.h",
215 "src/google/protobuf/compiler/cpp/cpp_service.cc", 361 "src/google/protobuf/compiler/cpp/cpp_service.cc",
216 "src/google/protobuf/compiler/cpp/cpp_service.h", 362 "src/google/protobuf/compiler/cpp/cpp_service.h",
217 "src/google/protobuf/compiler/cpp/cpp_string_field.cc", 363 "src/google/protobuf/compiler/cpp/cpp_string_field.cc",
218 "src/google/protobuf/compiler/cpp/cpp_string_field.h", 364 "src/google/protobuf/compiler/cpp/cpp_string_field.h",
365 "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
366 "src/google/protobuf/compiler/csharp/csharp_doc_comment.h",
367 "src/google/protobuf/compiler/csharp/csharp_enum.cc",
368 "src/google/protobuf/compiler/csharp/csharp_enum.h",
369 "src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
370 "src/google/protobuf/compiler/csharp/csharp_enum_field.h",
371 "src/google/protobuf/compiler/csharp/csharp_field_base.cc",
372 "src/google/protobuf/compiler/csharp/csharp_field_base.h",
373 "src/google/protobuf/compiler/csharp/csharp_generator.cc",
374 "src/google/protobuf/compiler/csharp/csharp_generator.h",
375 "src/google/protobuf/compiler/csharp/csharp_helpers.cc",
376 "src/google/protobuf/compiler/csharp/csharp_helpers.h",
377 "src/google/protobuf/compiler/csharp/csharp_map_field.cc",
378 "src/google/protobuf/compiler/csharp/csharp_map_field.h",
379 "src/google/protobuf/compiler/csharp/csharp_message.cc",
380 "src/google/protobuf/compiler/csharp/csharp_message.h",
381 "src/google/protobuf/compiler/csharp/csharp_message_field.cc",
382 "src/google/protobuf/compiler/csharp/csharp_message_field.h",
383 "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
384 "src/google/protobuf/compiler/csharp/csharp_primitive_field.h",
385 "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
386 "src/google/protobuf/compiler/csharp/csharp_reflection_class.h",
387 "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
388 "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h",
389 "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
390 "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h",
391 "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
392 "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h",
393 "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
394 "src/google/protobuf/compiler/csharp/csharp_source_generator_base.h",
395 "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
396 "src/google/protobuf/compiler/csharp/csharp_wrapper_field.h",
397 "src/google/protobuf/compiler/java/java_context.cc",
398 "src/google/protobuf/compiler/java/java_context.h",
399 "src/google/protobuf/compiler/java/java_doc_comment.cc",
400 "src/google/protobuf/compiler/java/java_doc_comment.h",
219 "src/google/protobuf/compiler/java/java_enum.cc", 401 "src/google/protobuf/compiler/java/java_enum.cc",
220 "src/google/protobuf/compiler/java/java_enum.h", 402 "src/google/protobuf/compiler/java/java_enum.h",
221 "src/google/protobuf/compiler/java/java_enum_field.cc", 403 "src/google/protobuf/compiler/java/java_enum_field.cc",
222 "src/google/protobuf/compiler/java/java_enum_field.h", 404 "src/google/protobuf/compiler/java/java_enum_field.h",
405 "src/google/protobuf/compiler/java/java_enum_field_lite.cc",
406 "src/google/protobuf/compiler/java/java_enum_field_lite.h",
407 "src/google/protobuf/compiler/java/java_enum_lite.cc",
408 "src/google/protobuf/compiler/java/java_enum_lite.h",
223 "src/google/protobuf/compiler/java/java_extension.cc", 409 "src/google/protobuf/compiler/java/java_extension.cc",
224 "src/google/protobuf/compiler/java/java_extension.h", 410 "src/google/protobuf/compiler/java/java_extension.h",
225 "src/google/protobuf/compiler/java/java_field.cc", 411 "src/google/protobuf/compiler/java/java_field.cc",
226 "src/google/protobuf/compiler/java/java_field.h", 412 "src/google/protobuf/compiler/java/java_field.h",
227 "src/google/protobuf/compiler/java/java_file.cc", 413 "src/google/protobuf/compiler/java/java_file.cc",
228 "src/google/protobuf/compiler/java/java_file.h", 414 "src/google/protobuf/compiler/java/java_file.h",
229 "src/google/protobuf/compiler/java/java_generator.cc", 415 "src/google/protobuf/compiler/java/java_generator.cc",
416 "src/google/protobuf/compiler/java/java_generator.h",
417 "src/google/protobuf/compiler/java/java_generator_factory.cc",
418 "src/google/protobuf/compiler/java/java_generator_factory.h",
230 "src/google/protobuf/compiler/java/java_helpers.cc", 419 "src/google/protobuf/compiler/java/java_helpers.cc",
231 "src/google/protobuf/compiler/java/java_helpers.h", 420 "src/google/protobuf/compiler/java/java_helpers.h",
421 "src/google/protobuf/compiler/java/java_lazy_message_field.cc",
422 "src/google/protobuf/compiler/java/java_lazy_message_field.h",
423 "src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc",
424 "src/google/protobuf/compiler/java/java_lazy_message_field_lite.h",
425 "src/google/protobuf/compiler/java/java_map_field.cc",
426 "src/google/protobuf/compiler/java/java_map_field.h",
427 "src/google/protobuf/compiler/java/java_map_field_lite.cc",
428 "src/google/protobuf/compiler/java/java_map_field_lite.h",
232 "src/google/protobuf/compiler/java/java_message.cc", 429 "src/google/protobuf/compiler/java/java_message.cc",
233 "src/google/protobuf/compiler/java/java_message.h", 430 "src/google/protobuf/compiler/java/java_message.h",
431 "src/google/protobuf/compiler/java/java_message_builder.cc",
432 "src/google/protobuf/compiler/java/java_message_builder.h",
433 "src/google/protobuf/compiler/java/java_message_builder_lite.cc",
434 "src/google/protobuf/compiler/java/java_message_builder_lite.h",
234 "src/google/protobuf/compiler/java/java_message_field.cc", 435 "src/google/protobuf/compiler/java/java_message_field.cc",
235 "src/google/protobuf/compiler/java/java_message_field.h", 436 "src/google/protobuf/compiler/java/java_message_field.h",
437 "src/google/protobuf/compiler/java/java_message_field_lite.cc",
438 "src/google/protobuf/compiler/java/java_message_field_lite.h",
439 "src/google/protobuf/compiler/java/java_message_lite.cc",
440 "src/google/protobuf/compiler/java/java_message_lite.h",
441 "src/google/protobuf/compiler/java/java_name_resolver.cc",
442 "src/google/protobuf/compiler/java/java_name_resolver.h",
236 "src/google/protobuf/compiler/java/java_primitive_field.cc", 443 "src/google/protobuf/compiler/java/java_primitive_field.cc",
237 "src/google/protobuf/compiler/java/java_primitive_field.h", 444 "src/google/protobuf/compiler/java/java_primitive_field.h",
445 "src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
446 "src/google/protobuf/compiler/java/java_primitive_field_lite.h",
238 "src/google/protobuf/compiler/java/java_service.cc", 447 "src/google/protobuf/compiler/java/java_service.cc",
239 "src/google/protobuf/compiler/java/java_service.h", 448 "src/google/protobuf/compiler/java/java_service.h",
449 "src/google/protobuf/compiler/java/java_shared_code_generator.cc",
450 "src/google/protobuf/compiler/java/java_shared_code_generator.h",
240 "src/google/protobuf/compiler/java/java_string_field.cc", 451 "src/google/protobuf/compiler/java/java_string_field.cc",
241 "src/google/protobuf/compiler/java/java_string_field.h", 452 "src/google/protobuf/compiler/java/java_string_field.h",
453 "src/google/protobuf/compiler/java/java_string_field_lite.cc",
454 "src/google/protobuf/compiler/java/java_string_field_lite.h",
455 "src/google/protobuf/compiler/javanano/javanano_enum.cc",
456 "src/google/protobuf/compiler/javanano/javanano_enum.h",
457 "src/google/protobuf/compiler/javanano/javanano_enum_field.cc",
458 "src/google/protobuf/compiler/javanano/javanano_enum_field.h",
459 "src/google/protobuf/compiler/javanano/javanano_extension.cc",
460 "src/google/protobuf/compiler/javanano/javanano_extension.h",
461 "src/google/protobuf/compiler/javanano/javanano_field.cc",
462 "src/google/protobuf/compiler/javanano/javanano_field.h",
463 "src/google/protobuf/compiler/javanano/javanano_file.cc",
464 "src/google/protobuf/compiler/javanano/javanano_file.h",
465 "src/google/protobuf/compiler/javanano/javanano_generator.cc",
466 "src/google/protobuf/compiler/javanano/javanano_generator.h",
467 "src/google/protobuf/compiler/javanano/javanano_helpers.cc",
468 "src/google/protobuf/compiler/javanano/javanano_helpers.h",
469 "src/google/protobuf/compiler/javanano/javanano_map_field.cc",
470 "src/google/protobuf/compiler/javanano/javanano_map_field.h",
471 "src/google/protobuf/compiler/javanano/javanano_message.cc",
472 "src/google/protobuf/compiler/javanano/javanano_message.h",
473 "src/google/protobuf/compiler/javanano/javanano_message_field.cc",
474 "src/google/protobuf/compiler/javanano/javanano_message_field.h",
475 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
476 "src/google/protobuf/compiler/javanano/javanano_primitive_field.h",
477 "src/google/protobuf/compiler/js/js_generator.cc",
478 "src/google/protobuf/compiler/js/js_generator.h",
242 "src/google/protobuf/compiler/main.cc", 479 "src/google/protobuf/compiler/main.cc",
480 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
481 "src/google/protobuf/compiler/objectivec/objectivec_enum.h",
482 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
483 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.h",
484 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
485 "src/google/protobuf/compiler/objectivec/objectivec_extension.h",
486 "src/google/protobuf/compiler/objectivec/objectivec_field.cc",
487 "src/google/protobuf/compiler/objectivec/objectivec_field.h",
488 "src/google/protobuf/compiler/objectivec/objectivec_file.cc",
489 "src/google/protobuf/compiler/objectivec/objectivec_file.h",
490 "src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
491 "src/google/protobuf/compiler/objectivec/objectivec_generator.h",
492 "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
493 "src/google/protobuf/compiler/objectivec/objectivec_helpers.h",
494 "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
495 "src/google/protobuf/compiler/objectivec/objectivec_map_field.h",
496 "src/google/protobuf/compiler/objectivec/objectivec_message.cc",
497 "src/google/protobuf/compiler/objectivec/objectivec_message.h",
498 "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
499 "src/google/protobuf/compiler/objectivec/objectivec_message_field.h",
500 "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
501 "src/google/protobuf/compiler/objectivec/objectivec_oneof.h",
502 "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
503 "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h",
243 "src/google/protobuf/compiler/plugin.cc", 504 "src/google/protobuf/compiler/plugin.cc",
505 "src/google/protobuf/compiler/plugin.h",
244 "src/google/protobuf/compiler/plugin.pb.cc", 506 "src/google/protobuf/compiler/plugin.pb.cc",
507 "src/google/protobuf/compiler/plugin.pb.h",
245 "src/google/protobuf/compiler/python/python_generator.cc", 508 "src/google/protobuf/compiler/python/python_generator.cc",
509 "src/google/protobuf/compiler/python/python_generator.h",
510 "src/google/protobuf/compiler/ruby/ruby_generator.cc",
511 "src/google/protobuf/compiler/ruby/ruby_generator.h",
246 "src/google/protobuf/compiler/subprocess.cc", 512 "src/google/protobuf/compiler/subprocess.cc",
247 "src/google/protobuf/compiler/subprocess.h", 513 "src/google/protobuf/compiler/subprocess.h",
248 "src/google/protobuf/compiler/zip_writer.cc", 514 "src/google/protobuf/compiler/zip_writer.cc",
249 "src/google/protobuf/compiler/zip_writer.h", 515 "src/google/protobuf/compiler/zip_writer.h",
250 ] 516 ]
251 517
252 configs -= [ "//build/config/compiler:chromium_code" ] 518 configs -= [ "//build/config/compiler:chromium_code" ]
253 configs += [ "//build/config/compiler:no_chromium_code" ] 519 configs += [
520 "//build/config/compiler:no_chromium_code",
521
522 # Must be after no_chromium_code for warning flags to be ordered
523 # correctly.
524 ":protobuf_warnings",
525 ]
254 if (is_win) { 526 if (is_win) {
255 # This is defined internally, don't warn on duplicate. 527 # This is defined internally, don't warn on duplicate.
256 configs -= [ "//build/config/win:lean_and_mean" ] 528 configs -= [ "//build/config/win:lean_and_mean" ]
257 } 529 }
258 530
259 cflags = protobuf_lite_cflags 531 cflags = protobuf_lite_cflags
260 532
261 deps = [ 533 deps = [
262 ":protobuf_full", 534 ":protobuf_full",
263 "//build/config/sanitizers:deps", 535 "//build/config/sanitizers:deps",
264 ] 536 ]
265 deps += [ "//build/config/sanitizers:deps" ] 537 deps += [ "//build/config/sanitizers:deps" ]
266 } 538 }
267 } 539 }
268 540
269 google_python_dir = "$root_out_dir/pyproto/google" 541 google_python_dir = "$root_out_dir/pyproto/google"
270 542
271 copy("copy_google") { 543 copy("copy_google") {
272 sources = [ 544 sources = [
273 "__init__.py", 545 "__init__.py",
274 ] 546 ]
275 outputs = [ 547 outputs = [
276 "$google_python_dir/{{source_file_part}}", 548 "$google_python_dir/{{source_file_part}}",
277 ] 549 ]
278 } 550 }
279 551
552 copy("copy_six") {
553 sources = [
554 "third_party/six/six.py",
555 ]
556 outputs = [
557 "$google_python_dir/third_party/six/{{source_file_part}}",
558 ]
559 }
560
280 copy("copy_google_protobuf") { 561 copy("copy_google_protobuf") {
281 sources = [ 562 sources = [
282 "python/google/protobuf/__init__.py", 563 "python/google/protobuf/__init__.py",
283 "python/google/protobuf/descriptor.py", 564 "python/google/protobuf/descriptor.py",
284 "python/google/protobuf/descriptor_database.py", 565 "python/google/protobuf/descriptor_database.py",
285 "python/google/protobuf/descriptor_pool.py", 566 "python/google/protobuf/descriptor_pool.py",
567 "python/google/protobuf/json_format.py",
286 "python/google/protobuf/message.py", 568 "python/google/protobuf/message.py",
287 "python/google/protobuf/message_factory.py", 569 "python/google/protobuf/message_factory.py",
570 "python/google/protobuf/proto_builder.py",
288 "python/google/protobuf/reflection.py", 571 "python/google/protobuf/reflection.py",
289 "python/google/protobuf/service.py", 572 "python/google/protobuf/service.py",
290 "python/google/protobuf/service_reflection.py", 573 "python/google/protobuf/service_reflection.py",
574 "python/google/protobuf/symbol_database.py",
575 "python/google/protobuf/text_encoding.py",
291 "python/google/protobuf/text_format.py", 576 "python/google/protobuf/text_format.py",
292 577
293 # TODO(ncarter): protoc"s python generator treats 578 # TODO(ncarter): protoc's python generator treats descriptor.proto
294 # descriptor.proto specially, but it's not possible to trigger 579 # specially, but only when the input path is exactly
295 # the special treatment unless you run protoc from ./src/src 580 # "google/protobuf/descriptor.proto". I'm not sure how to execute a rule
296 # (the treatment is based on the path to the .proto file 581 # from a different directory. For now, use a manually-generated copy of
297 # matching a constant exactly). I'm not sure how to convince 582 # descriptor_pb2.py.
298 # gyp to execute a rule from a different directory. Until this 583 "python/google/protobuf/descriptor_pb2.py",
299 # is resolved, use a copy of descriptor_pb2.py that I manually
300 # generated.
301 "descriptor_pb2.py",
302 ] 584 ]
303 outputs = [ 585 outputs = [
304 "$google_python_dir/protobuf/{{source_file_part}}", 586 "$google_python_dir/protobuf/{{source_file_part}}",
305 ] 587 ]
306 } 588 }
307 589
308 copy("copy_google_protobuf_internal") { 590 copy("copy_google_protobuf_internal") {
309 sources = [ 591 sources = [
310 "python/google/protobuf/internal/__init__.py", 592 "python/google/protobuf/internal/__init__.py",
593 "python/google/protobuf/internal/_parameterized.py",
311 "python/google/protobuf/internal/api_implementation.py", 594 "python/google/protobuf/internal/api_implementation.py",
312 "python/google/protobuf/internal/containers.py", 595 "python/google/protobuf/internal/containers.py",
313 "python/google/protobuf/internal/cpp_message.py",
314 "python/google/protobuf/internal/decoder.py", 596 "python/google/protobuf/internal/decoder.py",
315 "python/google/protobuf/internal/encoder.py", 597 "python/google/protobuf/internal/encoder.py",
316 "python/google/protobuf/internal/enum_type_wrapper.py", 598 "python/google/protobuf/internal/enum_type_wrapper.py",
317 "python/google/protobuf/internal/generator_test.py",
318 "python/google/protobuf/internal/message_listener.py", 599 "python/google/protobuf/internal/message_listener.py",
319 "python/google/protobuf/internal/python_message.py", 600 "python/google/protobuf/internal/python_message.py",
320 "python/google/protobuf/internal/type_checkers.py", 601 "python/google/protobuf/internal/type_checkers.py",
602 "python/google/protobuf/internal/well_known_types.py",
321 "python/google/protobuf/internal/wire_format.py", 603 "python/google/protobuf/internal/wire_format.py",
322 ] 604 ]
323 outputs = [ 605 outputs = [
324 "$google_python_dir/protobuf/internal/{{source_file_part}}", 606 "$google_python_dir/protobuf/internal/{{source_file_part}}",
325 ] 607 ]
326 } 608 }
327 609
328 group("py_proto") { 610 group("py_proto") {
329 public_deps = [ 611 public_deps = [
330 ":copy_google", 612 ":copy_google",
331 ":copy_google_protobuf", 613 ":copy_google_protobuf",
332 ":copy_google_protobuf_internal", 614 ":copy_google_protobuf_internal",
615 ":copy_six",
333 ] 616 ]
334 617
335 # Targets that depend on this should depend on the copied data files. 618 # Targets that depend on this should depend on the copied data files.
336 data = get_target_outputs(":copy_google") 619 data = get_target_outputs(":copy_google")
620 data += get_target_outputs(":copy_six")
337 data += get_target_outputs(":copy_google_protobuf") 621 data += get_target_outputs(":copy_google_protobuf")
338 data += get_target_outputs(":copy_google_protobuf_internal") 622 data += get_target_outputs(":copy_google_protobuf_internal")
339 } 623 }
OLDNEW
« no previous file with comments | « third_party/protobuf/BUILD ('k') | third_party/protobuf/CHANGES.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698