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 = [ |
| 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", |
| 117 "src/google/protobuf/testing/file.h", |
| 118 "src/google/protobuf/testing/file.cc", |
| 119 "src/google/protobuf/testing/googletest.h", |
| 120 "src/google/protobuf/testing/googletest.cc", |
71 "src/google/protobuf/wire_format_lite.cc", | 121 "src/google/protobuf/wire_format_lite.cc", |
72 "src/google/protobuf/wire_format_lite.h", | 122 "src/google/protobuf/wire_format_lite.h", |
73 "src/google/protobuf/wire_format_lite_inl.h", | 123 "src/google/protobuf/wire_format_lite_inl.h", |
74 "$config_h_dir/config.h", | |
75 ] | 124 ] |
76 | 125 |
77 protobuf_lite_cflags = [] | 126 protobuf_lite_cflags = [] |
78 if (is_win) { | 127 if (is_win) { |
79 protobuf_lite_cflags = [ | 128 protobuf_lite_cflags = [ |
80 "/wd4018", # Signed/unsigned mismatch in comparison. | 129 "/wd4018", # signed/unsigned mismatch in comparison |
81 "/wd4244", # Implicit conversion, possible loss of data. | 130 "/wd4065", # switch statement contains 'default' but no 'case' labels |
82 "/wd4355", # 'this' used in base member initializer list. | 131 "/wd4146", # unary minus operator applied to unsigned type |
83 "/wd4267", # Size_t to int truncation. | 132 "/wd4244", # implicit conversion, possible loss of data |
84 "/wd4291", # No matching operator delete for a placement new. | 133 "/wd4267", # size_t to int truncation |
| 134 "/wd4291", # no matching operator delete for a placement new. |
| 135 "/wd4305", # double to float truncation |
| 136 "/wd4355", # 'this' used in base member initializer list |
| 137 "/wd4506", # no definition for inline function (protobuf issue #240) |
85 ] | 138 ] |
86 } | 139 } |
87 | 140 |
88 component("protobuf_lite") { | 141 component("protobuf_lite") { |
89 sources = protobuf_lite_sources | 142 sources = protobuf_lite_sources |
90 | 143 |
91 configs -= [ "//build/config/compiler:chromium_code" ] | 144 configs -= [ "//build/config/compiler:chromium_code" ] |
92 configs += [ "//build/config/compiler:no_chromium_code" ] | 145 configs += [ |
| 146 "//build/config/compiler:no_chromium_code", |
| 147 |
| 148 # Must be after no_chromium_code for warning flags to be ordered |
| 149 # correctly. |
| 150 ":protobuf_warnings", |
| 151 ] |
| 152 |
93 if (is_win) { | 153 if (is_win) { |
94 configs -= [ "//build/config/win:lean_and_mean" ] | 154 configs -= [ "//build/config/win:lean_and_mean" ] |
95 } | 155 } |
| 156 |
96 public_configs = [ | 157 public_configs = [ |
97 ":protobuf_config", | 158 ":protobuf_config", |
98 | 159 |
99 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 160 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
100 "//build/config/compiler:no_size_t_to_int_warning", | 161 "//build/config/compiler:no_size_t_to_int_warning", |
101 ] | 162 ] |
102 | 163 |
| 164 deps = [ |
| 165 "//build/config/sanitizers:deps", |
| 166 ] |
| 167 |
103 cflags = protobuf_lite_cflags | 168 cflags = protobuf_lite_cflags |
104 | 169 |
105 # Required for component builds. See http://crbug.com/172800. | 170 # Required for component builds. See http://crbug.com/172800. |
106 if (is_component_build) { | 171 if (is_component_build) { |
107 public_configs += [ ":protobuf_use_dlls" ] | 172 public_configs += [ ":protobuf_use_dlls" ] |
108 defines = [ "LIBPROTOBUF_EXPORTS" ] | 173 defines = [ "LIBPROTOBUF_EXPORTS" ] |
109 } | 174 } |
110 } | 175 } |
111 | 176 |
112 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't | 177 # 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 | 178 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls |
114 # into that category. Do not use in Chrome code. | 179 # into that category. Do not use in Chrome code. |
115 | |
116 source_set("protobuf_full") { | 180 source_set("protobuf_full") { |
117 # Prevent people from depending on this outside our file. | 181 # Prevent people from depending on this outside our file. |
118 visibility = [ ":*" ] | 182 visibility = [ ":*" ] |
119 | 183 |
120 sources = protobuf_lite_sources | 184 sources = protobuf_lite_sources |
121 sources += [ | 185 sources += [ |
122 "src/google/protobuf/compiler/code_generator.h", | 186 "src/google/protobuf/any.cc", |
123 "src/google/protobuf/compiler/command_line_interface.h", | 187 "src/google/protobuf/any.h", |
| 188 "src/google/protobuf/any.pb.cc", |
| 189 "src/google/protobuf/any.pb.h", |
| 190 "src/google/protobuf/api.pb.cc", |
| 191 "src/google/protobuf/api.pb.h", |
| 192 "src/google/protobuf/compiler/importer.cc", |
124 "src/google/protobuf/compiler/importer.h", | 193 "src/google/protobuf/compiler/importer.h", |
125 "src/google/protobuf/compiler/java/java_doc_comment.cc", | 194 "src/google/protobuf/compiler/parser.cc", |
126 "src/google/protobuf/compiler/java/java_doc_comment.h", | |
127 "src/google/protobuf/compiler/parser.h", | 195 "src/google/protobuf/compiler/parser.h", |
128 "src/google/protobuf/descriptor.cc", | 196 "src/google/protobuf/descriptor.cc", |
129 "src/google/protobuf/descriptor.h", | 197 "src/google/protobuf/descriptor.h", |
130 "src/google/protobuf/descriptor.pb.cc", | 198 "src/google/protobuf/descriptor.pb.cc", |
131 "src/google/protobuf/descriptor.pb.h", | 199 "src/google/protobuf/descriptor.pb.h", |
132 "src/google/protobuf/descriptor_database.cc", | 200 "src/google/protobuf/descriptor_database.cc", |
133 "src/google/protobuf/descriptor_database.h", | 201 "src/google/protobuf/descriptor_database.h", |
| 202 "src/google/protobuf/duration.pb.cc", |
| 203 "src/google/protobuf/duration.pb.h", |
134 "src/google/protobuf/dynamic_message.cc", | 204 "src/google/protobuf/dynamic_message.cc", |
135 "src/google/protobuf/dynamic_message.h", | 205 "src/google/protobuf/dynamic_message.h", |
| 206 "src/google/protobuf/empty.pb.cc", |
| 207 "src/google/protobuf/empty.pb.h", |
136 "src/google/protobuf/extension_set_heavy.cc", | 208 "src/google/protobuf/extension_set_heavy.cc", |
| 209 "src/google/protobuf/field_mask.pb.cc", |
| 210 "src/google/protobuf/field_mask.pb.h", |
137 "src/google/protobuf/generated_enum_reflection.h", | 211 "src/google/protobuf/generated_enum_reflection.h", |
| 212 "src/google/protobuf/generated_enum_util.h", |
138 "src/google/protobuf/generated_message_reflection.cc", | 213 "src/google/protobuf/generated_message_reflection.cc", |
139 "src/google/protobuf/generated_message_reflection.h", | 214 "src/google/protobuf/generated_message_reflection.h", |
140 "src/google/protobuf/io/gzip_stream.h", | 215 |
| 216 # gzip_stream.cc pulls in zlib, but it's not actually used by protoc, just |
| 217 # by test code, so instead of compiling zlib for the host, let's just |
| 218 # exclude this. |
| 219 # "src/google/protobuf/io/gzip_stream.cc", |
| 220 # "src/google/protobuf/io/gzip_stream.h", |
| 221 |
| 222 "src/google/protobuf/io/printer.cc", |
141 "src/google/protobuf/io/printer.h", | 223 "src/google/protobuf/io/printer.h", |
| 224 "src/google/protobuf/io/strtod.cc", |
| 225 "src/google/protobuf/io/strtod.h", |
| 226 "src/google/protobuf/io/tokenizer.cc", |
142 "src/google/protobuf/io/tokenizer.h", | 227 "src/google/protobuf/io/tokenizer.h", |
| 228 "src/google/protobuf/io/zero_copy_stream_impl.cc", |
143 "src/google/protobuf/io/zero_copy_stream_impl.h", | 229 "src/google/protobuf/io/zero_copy_stream_impl.h", |
| 230 "src/google/protobuf/map_entry.h", |
| 231 "src/google/protobuf/map_field.cc", |
| 232 "src/google/protobuf/map_field.h", |
| 233 "src/google/protobuf/map_field_inl.h", |
144 "src/google/protobuf/message.cc", | 234 "src/google/protobuf/message.cc", |
145 "src/google/protobuf/message.h", | 235 "src/google/protobuf/message.h", |
| 236 "src/google/protobuf/metadata.h", |
| 237 "src/google/protobuf/reflection.h", |
| 238 "src/google/protobuf/reflection_internal.h", |
146 "src/google/protobuf/reflection_ops.cc", | 239 "src/google/protobuf/reflection_ops.cc", |
147 "src/google/protobuf/reflection_ops.h", | 240 "src/google/protobuf/reflection_ops.h", |
148 "src/google/protobuf/service.cc", | 241 "src/google/protobuf/service.cc", |
149 "src/google/protobuf/service.h", | 242 "src/google/protobuf/service.h", |
150 "src/google/protobuf/stubs/stl_util.h", | 243 "src/google/protobuf/source_context.pb.cc", |
151 "src/google/protobuf/stubs/stringprintf.cc", | 244 "src/google/protobuf/source_context.pb.h", |
152 "src/google/protobuf/stubs/stringprintf.h", | 245 "src/google/protobuf/struct.pb.cc", |
153 "src/google/protobuf/stubs/structurally_valid.cc", | 246 "src/google/protobuf/struct.pb.h", |
154 "src/google/protobuf/stubs/strutil.cc", | 247 "src/google/protobuf/stubs/mathlimits.cc", |
155 "src/google/protobuf/stubs/strutil.h", | 248 "src/google/protobuf/stubs/mathlimits.h", |
| 249 "src/google/protobuf/stubs/mathutil.h", |
| 250 "src/google/protobuf/stubs/singleton.h", |
156 "src/google/protobuf/stubs/substitute.cc", | 251 "src/google/protobuf/stubs/substitute.cc", |
157 "src/google/protobuf/stubs/substitute.h", | 252 "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", | 253 "src/google/protobuf/text_format.cc", |
161 "src/google/protobuf/text_format.h", | 254 "src/google/protobuf/text_format.h", |
| 255 "src/google/protobuf/timestamp.pb.cc", |
| 256 "src/google/protobuf/timestamp.pb.h", |
| 257 "src/google/protobuf/type.pb.cc", |
| 258 "src/google/protobuf/type.pb.h", |
| 259 "src/google/protobuf/unknown_field_set.cc", |
| 260 "src/google/protobuf/unknown_field_set.h", |
| 261 "src/google/protobuf/util/field_comparator.cc", |
| 262 "src/google/protobuf/util/field_comparator.h", |
| 263 "src/google/protobuf/util/field_mask_util.cc", |
| 264 "src/google/protobuf/util/field_mask_util.h", |
| 265 "src/google/protobuf/util/internal/constants.h", |
| 266 "src/google/protobuf/util/internal/datapiece.cc", |
| 267 "src/google/protobuf/util/internal/datapiece.h", |
| 268 "src/google/protobuf/util/internal/default_value_objectwriter.cc", |
| 269 "src/google/protobuf/util/internal/default_value_objectwriter.h", |
| 270 "src/google/protobuf/util/internal/error_listener.cc", |
| 271 "src/google/protobuf/util/internal/error_listener.h", |
| 272 "src/google/protobuf/util/internal/field_mask_utility.cc", |
| 273 "src/google/protobuf/util/internal/field_mask_utility.h", |
| 274 "src/google/protobuf/util/internal/json_escaping.cc", |
| 275 "src/google/protobuf/util/internal/json_escaping.h", |
| 276 "src/google/protobuf/util/internal/json_objectwriter.cc", |
| 277 "src/google/protobuf/util/internal/json_objectwriter.h", |
| 278 "src/google/protobuf/util/internal/json_stream_parser.cc", |
| 279 "src/google/protobuf/util/internal/json_stream_parser.h", |
| 280 "src/google/protobuf/util/internal/location_tracker.h", |
| 281 "src/google/protobuf/util/internal/object_location_tracker.h", |
| 282 "src/google/protobuf/util/internal/object_source.h", |
| 283 "src/google/protobuf/util/internal/object_writer.cc", |
| 284 "src/google/protobuf/util/internal/object_writer.h", |
| 285 "src/google/protobuf/util/internal/proto_writer.cc", |
| 286 "src/google/protobuf/util/internal/proto_writer.h", |
| 287 "src/google/protobuf/util/internal/protostream_objectsource.cc", |
| 288 "src/google/protobuf/util/internal/protostream_objectsource.h", |
| 289 "src/google/protobuf/util/internal/protostream_objectwriter.cc", |
| 290 "src/google/protobuf/util/internal/protostream_objectwriter.h", |
| 291 "src/google/protobuf/util/internal/structured_object_writer.h", |
| 292 "src/google/protobuf/util/internal/type_info.cc", |
| 293 "src/google/protobuf/util/internal/type_info.h", |
| 294 "src/google/protobuf/util/internal/type_info_test_helper.cc", |
| 295 "src/google/protobuf/util/internal/type_info_test_helper.h", |
| 296 "src/google/protobuf/util/internal/utility.cc", |
| 297 "src/google/protobuf/util/internal/utility.h", |
| 298 "src/google/protobuf/util/json_util.cc", |
| 299 "src/google/protobuf/util/json_util.h", |
| 300 "src/google/protobuf/util/message_differencer.cc", |
| 301 "src/google/protobuf/util/message_differencer.h", |
| 302 "src/google/protobuf/util/time_util.cc", |
| 303 "src/google/protobuf/util/time_util.h", |
| 304 "src/google/protobuf/util/type_resolver.h", |
| 305 "src/google/protobuf/util/type_resolver_util.cc", |
| 306 "src/google/protobuf/util/type_resolver_util.h", |
162 "src/google/protobuf/wire_format.cc", | 307 "src/google/protobuf/wire_format.cc", |
163 "src/google/protobuf/wire_format.h", | 308 "src/google/protobuf/wire_format.h", |
164 | 309 "src/google/protobuf/wrappers.pb.cc", |
165 # This file pulls in zlib, but it's not actually used by protoc, so | 310 "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 ] | 311 ] |
174 | 312 |
175 configs -= [ "//build/config/compiler:chromium_code" ] | 313 configs -= [ "//build/config/compiler:chromium_code" ] |
176 configs += [ "//build/config/compiler:no_chromium_code" ] | 314 configs += [ |
| 315 "//build/config/compiler:no_chromium_code", |
| 316 |
| 317 # Must be after no_chromium_code for warning flags to be ordered |
| 318 # correctly. |
| 319 ":protobuf_warnings", |
| 320 ] |
177 if (is_win) { | 321 if (is_win) { |
178 configs -= [ "//build/config/win:lean_and_mean" ] | 322 configs -= [ "//build/config/win:lean_and_mean" ] |
179 } | 323 } |
180 public_configs = [ | 324 public_configs = [ |
181 ":protobuf_config", | 325 ":protobuf_config", |
182 | 326 |
183 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 327 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
184 "//build/config/compiler:no_size_t_to_int_warning", | 328 "//build/config/compiler:no_size_t_to_int_warning", |
185 ] | 329 ] |
186 | 330 |
187 cflags = protobuf_lite_cflags | 331 cflags = protobuf_lite_cflags |
188 } | 332 } |
189 | 333 |
190 # Only compile the compiler for the host architecture. | 334 # Only compile the compiler for the host architecture. |
191 if (current_toolchain == host_toolchain) { | 335 if (current_toolchain == host_toolchain) { |
192 executable("protoc") { | 336 executable("protoc") { |
193 sources = [ | 337 sources = [ |
194 "src/google/protobuf/compiler/code_generator.cc", | 338 "src/google/protobuf/compiler/code_generator.cc", |
| 339 "src/google/protobuf/compiler/code_generator.h", |
195 "src/google/protobuf/compiler/command_line_interface.cc", | 340 "src/google/protobuf/compiler/command_line_interface.cc", |
| 341 "src/google/protobuf/compiler/command_line_interface.h", |
196 "src/google/protobuf/compiler/cpp/cpp_enum.cc", | 342 "src/google/protobuf/compiler/cpp/cpp_enum.cc", |
197 "src/google/protobuf/compiler/cpp/cpp_enum.h", | 343 "src/google/protobuf/compiler/cpp/cpp_enum.h", |
198 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", | 344 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", |
199 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", | 345 "src/google/protobuf/compiler/cpp/cpp_enum_field.h", |
200 "src/google/protobuf/compiler/cpp/cpp_extension.cc", | 346 "src/google/protobuf/compiler/cpp/cpp_extension.cc", |
201 "src/google/protobuf/compiler/cpp/cpp_extension.h", | 347 "src/google/protobuf/compiler/cpp/cpp_extension.h", |
202 "src/google/protobuf/compiler/cpp/cpp_field.cc", | 348 "src/google/protobuf/compiler/cpp/cpp_field.cc", |
203 "src/google/protobuf/compiler/cpp/cpp_field.h", | 349 "src/google/protobuf/compiler/cpp/cpp_field.h", |
204 "src/google/protobuf/compiler/cpp/cpp_file.cc", | 350 "src/google/protobuf/compiler/cpp/cpp_file.cc", |
205 "src/google/protobuf/compiler/cpp/cpp_file.h", | 351 "src/google/protobuf/compiler/cpp/cpp_file.h", |
206 "src/google/protobuf/compiler/cpp/cpp_generator.cc", | 352 "src/google/protobuf/compiler/cpp/cpp_generator.cc", |
| 353 "src/google/protobuf/compiler/cpp/cpp_generator.h", |
207 "src/google/protobuf/compiler/cpp/cpp_helpers.cc", | 354 "src/google/protobuf/compiler/cpp/cpp_helpers.cc", |
208 "src/google/protobuf/compiler/cpp/cpp_helpers.h", | 355 "src/google/protobuf/compiler/cpp/cpp_helpers.h", |
| 356 "src/google/protobuf/compiler/cpp/cpp_map_field.cc", |
| 357 "src/google/protobuf/compiler/cpp/cpp_map_field.h", |
209 "src/google/protobuf/compiler/cpp/cpp_message.cc", | 358 "src/google/protobuf/compiler/cpp/cpp_message.cc", |
210 "src/google/protobuf/compiler/cpp/cpp_message.h", | 359 "src/google/protobuf/compiler/cpp/cpp_message.h", |
211 "src/google/protobuf/compiler/cpp/cpp_message_field.cc", | 360 "src/google/protobuf/compiler/cpp/cpp_message_field.cc", |
212 "src/google/protobuf/compiler/cpp/cpp_message_field.h", | 361 "src/google/protobuf/compiler/cpp/cpp_message_field.h", |
| 362 "src/google/protobuf/compiler/cpp/cpp_options.h", |
213 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", | 363 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", |
214 "src/google/protobuf/compiler/cpp/cpp_primitive_field.h", | 364 "src/google/protobuf/compiler/cpp/cpp_primitive_field.h", |
215 "src/google/protobuf/compiler/cpp/cpp_service.cc", | 365 "src/google/protobuf/compiler/cpp/cpp_service.cc", |
216 "src/google/protobuf/compiler/cpp/cpp_service.h", | 366 "src/google/protobuf/compiler/cpp/cpp_service.h", |
217 "src/google/protobuf/compiler/cpp/cpp_string_field.cc", | 367 "src/google/protobuf/compiler/cpp/cpp_string_field.cc", |
218 "src/google/protobuf/compiler/cpp/cpp_string_field.h", | 368 "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", | 369 "src/google/protobuf/compiler/main.cc", |
243 "src/google/protobuf/compiler/plugin.cc", | 370 "src/google/protobuf/compiler/plugin.cc", |
| 371 "src/google/protobuf/compiler/plugin.h", |
244 "src/google/protobuf/compiler/plugin.pb.cc", | 372 "src/google/protobuf/compiler/plugin.pb.cc", |
| 373 "src/google/protobuf/compiler/plugin.pb.h", |
245 "src/google/protobuf/compiler/python/python_generator.cc", | 374 "src/google/protobuf/compiler/python/python_generator.cc", |
| 375 "src/google/protobuf/compiler/python/python_generator.h", |
246 "src/google/protobuf/compiler/subprocess.cc", | 376 "src/google/protobuf/compiler/subprocess.cc", |
247 "src/google/protobuf/compiler/subprocess.h", | 377 "src/google/protobuf/compiler/subprocess.h", |
248 "src/google/protobuf/compiler/zip_writer.cc", | 378 "src/google/protobuf/compiler/zip_writer.cc", |
249 "src/google/protobuf/compiler/zip_writer.h", | 379 "src/google/protobuf/compiler/zip_writer.h", |
250 ] | 380 ] |
251 | 381 |
252 configs -= [ "//build/config/compiler:chromium_code" ] | 382 configs -= [ "//build/config/compiler:chromium_code" ] |
253 configs += [ "//build/config/compiler:no_chromium_code" ] | 383 configs += [ |
| 384 "//build/config/compiler:no_chromium_code", |
| 385 |
| 386 # Must be after no_chromium_code for warning flags to be ordered |
| 387 # correctly. |
| 388 ":protobuf_warnings", |
| 389 ] |
254 if (is_win) { | 390 if (is_win) { |
255 # This is defined internally, don't warn on duplicate. | 391 # This is defined internally, don't warn on duplicate. |
256 configs -= [ "//build/config/win:lean_and_mean" ] | 392 configs -= [ "//build/config/win:lean_and_mean" ] |
257 } | 393 } |
258 | 394 |
259 cflags = protobuf_lite_cflags | 395 cflags = protobuf_lite_cflags |
260 | 396 |
261 deps = [ | 397 deps = [ |
262 ":protobuf_full", | 398 ":protobuf_full", |
263 "//build/config/sanitizers:deps", | 399 "//build/config/sanitizers:deps", |
264 ] | 400 ] |
265 deps += [ "//build/config/sanitizers:deps" ] | 401 deps += [ "//build/config/sanitizers:deps" ] |
266 } | 402 } |
267 } | 403 } |
268 | 404 |
269 google_python_dir = "$root_out_dir/pyproto/google" | 405 google_python_dir = "$root_out_dir/pyproto/google" |
270 | 406 |
271 copy("copy_google") { | 407 copy("copy_google") { |
272 sources = [ | 408 sources = [ |
273 "__init__.py", | 409 "__init__.py", |
274 ] | 410 ] |
275 outputs = [ | 411 outputs = [ |
276 "$google_python_dir/{{source_file_part}}", | 412 "$google_python_dir/{{source_file_part}}", |
277 ] | 413 ] |
278 } | 414 } |
279 | 415 |
| 416 copy("copy_six") { |
| 417 sources = [ |
| 418 "third_party/six/six.py", |
| 419 ] |
| 420 outputs = [ |
| 421 "$google_python_dir/third_party/six/{{source_file_part}}", |
| 422 ] |
| 423 } |
| 424 |
280 copy("copy_google_protobuf") { | 425 copy("copy_google_protobuf") { |
281 sources = [ | 426 sources = [ |
282 "python/google/protobuf/__init__.py", | 427 "python/google/protobuf/__init__.py", |
283 "python/google/protobuf/descriptor.py", | 428 "python/google/protobuf/descriptor.py", |
284 "python/google/protobuf/descriptor_database.py", | 429 "python/google/protobuf/descriptor_database.py", |
285 "python/google/protobuf/descriptor_pool.py", | 430 "python/google/protobuf/descriptor_pool.py", |
| 431 "python/google/protobuf/json_format.py", |
286 "python/google/protobuf/message.py", | 432 "python/google/protobuf/message.py", |
287 "python/google/protobuf/message_factory.py", | 433 "python/google/protobuf/message_factory.py", |
| 434 "python/google/protobuf/proto_builder.py", |
288 "python/google/protobuf/reflection.py", | 435 "python/google/protobuf/reflection.py", |
289 "python/google/protobuf/service.py", | 436 "python/google/protobuf/service.py", |
290 "python/google/protobuf/service_reflection.py", | 437 "python/google/protobuf/service_reflection.py", |
| 438 "python/google/protobuf/symbol_database.py", |
| 439 "python/google/protobuf/text_encoding.py", |
291 "python/google/protobuf/text_format.py", | 440 "python/google/protobuf/text_format.py", |
292 | 441 |
293 # TODO(ncarter): protoc"s python generator treats | 442 # TODO(ncarter): protoc's python generator treats descriptor.proto |
294 # descriptor.proto specially, but it's not possible to trigger | 443 # specially, but only when the input path is exactly |
295 # the special treatment unless you run protoc from ./src/src | 444 # "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 | 445 # from a different directory. For now, use a manually-generated copy of |
297 # matching a constant exactly). I'm not sure how to convince | 446 # descriptor_pb2.py. |
298 # gyp to execute a rule from a different directory. Until this | 447 "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 ] | 448 ] |
303 outputs = [ | 449 outputs = [ |
304 "$google_python_dir/protobuf/{{source_file_part}}", | 450 "$google_python_dir/protobuf/{{source_file_part}}", |
305 ] | 451 ] |
306 } | 452 } |
307 | 453 |
308 copy("copy_google_protobuf_internal") { | 454 copy("copy_google_protobuf_internal") { |
309 sources = [ | 455 sources = [ |
310 "python/google/protobuf/internal/__init__.py", | 456 "python/google/protobuf/internal/__init__.py", |
| 457 "python/google/protobuf/internal/_parameterized.py", |
311 "python/google/protobuf/internal/api_implementation.py", | 458 "python/google/protobuf/internal/api_implementation.py", |
312 "python/google/protobuf/internal/containers.py", | 459 "python/google/protobuf/internal/containers.py", |
313 "python/google/protobuf/internal/cpp_message.py", | |
314 "python/google/protobuf/internal/decoder.py", | 460 "python/google/protobuf/internal/decoder.py", |
315 "python/google/protobuf/internal/encoder.py", | 461 "python/google/protobuf/internal/encoder.py", |
316 "python/google/protobuf/internal/enum_type_wrapper.py", | 462 "python/google/protobuf/internal/enum_type_wrapper.py", |
317 "python/google/protobuf/internal/generator_test.py", | |
318 "python/google/protobuf/internal/message_listener.py", | 463 "python/google/protobuf/internal/message_listener.py", |
319 "python/google/protobuf/internal/python_message.py", | 464 "python/google/protobuf/internal/python_message.py", |
320 "python/google/protobuf/internal/type_checkers.py", | 465 "python/google/protobuf/internal/type_checkers.py", |
| 466 "python/google/protobuf/internal/well_known_types.py", |
321 "python/google/protobuf/internal/wire_format.py", | 467 "python/google/protobuf/internal/wire_format.py", |
322 ] | 468 ] |
323 outputs = [ | 469 outputs = [ |
324 "$google_python_dir/protobuf/internal/{{source_file_part}}", | 470 "$google_python_dir/protobuf/internal/{{source_file_part}}", |
325 ] | 471 ] |
326 } | 472 } |
327 | 473 |
328 group("py_proto") { | 474 group("py_proto") { |
329 public_deps = [ | 475 public_deps = [ |
330 ":copy_google", | 476 ":copy_google", |
331 ":copy_google_protobuf", | 477 ":copy_google_protobuf", |
332 ":copy_google_protobuf_internal", | 478 ":copy_google_protobuf_internal", |
| 479 ":copy_six", |
333 ] | 480 ] |
334 | 481 |
335 # Targets that depend on this should depend on the copied data files. | 482 # Targets that depend on this should depend on the copied data files. |
336 data = get_target_outputs(":copy_google") | 483 data = get_target_outputs(":copy_google") |
| 484 data += get_target_outputs(":copy_six") |
337 data += get_target_outputs(":copy_google_protobuf") | 485 data += get_target_outputs(":copy_google_protobuf") |
338 data += get_target_outputs(":copy_google_protobuf_internal") | 486 data += get_target_outputs(":copy_google_protobuf_internal") |
339 } | 487 } |
OLD | NEW |