blob: bf8946282f312fc5953885993d123e262c585c8f [file] [log] [blame]
Jisi Liud19604f2015-06-17 17:37:58 -07001# Bazel (http://bazel.io/) BUILD file for Protobuf.
2
3licenses(["notice"])
4
Piotr Sikorafaea19c2016-08-04 15:32:14 -07005exports_files(["LICENSE"])
6
Jorge Canizalesd5d7bb32015-06-28 15:23:02 -07007################################################################################
8# Protobuf Runtime Library
9################################################################################
10
Jisi Liud19604f2015-06-17 17:37:58 -070011COPTS = [
12 "-DHAVE_PTHREAD",
13 "-Wall",
14 "-Wwrite-strings",
15 "-Woverloaded-virtual",
16 "-Wno-sign-compare",
Andy Hochhausb2b65842016-10-08 15:40:29 -070017 "-Wno-unused-function",
Jisi Liud19604f2015-06-17 17:37:58 -070018]
19
Andrew Harpb56b4612016-04-04 15:13:30 -040020config_setting(
21 name = "android",
22 values = {
23 "crosstool_top": "//external:android/crosstool",
24 },
25)
26
27# Android builds do not need to link in a separate pthread library.
28LINK_OPTS = select({
Andrew Harp3b4e7dc2016-04-04 16:13:31 -040029 ":android": [],
Daniel Ylitalo32fa55e2017-01-25 22:04:11 +010030 "//conditions:default": ["-lpthread", "-lm"],
Andrew Harpb56b4612016-04-04 15:13:30 -040031})
Jisi Liud19604f2015-06-17 17:37:58 -070032
Jisi Liu04658a32015-10-20 15:00:13 -070033load(
cgrushko65a4d202017-02-08 15:23:57 -050034 ":protobuf.bzl",
Jisi Liu04658a32015-10-20 15:00:13 -070035 "cc_proto_library",
36 "py_proto_library",
David Z. Chen02cd45c2016-05-20 16:49:04 -070037 "internal_copied_filegroup",
Steven Parkesea188662016-02-25 07:53:19 -080038 "internal_gen_well_known_protos_java",
Jisi Liu04658a32015-10-20 15:00:13 -070039 "internal_protobuf_py_tests",
40)
Jisi Liu39362b32015-10-14 17:12:11 -070041
Pete Wardencb392042016-02-23 10:18:32 -080042config_setting(
Pete Wardenf0c1a862016-03-09 13:03:52 -080043 name = "ios_armv7",
Pete Wardencb392042016-02-23 10:18:32 -080044 values = {
45 "ios_cpu": "armv7",
Pete Wardenf0c1a862016-03-09 13:03:52 -080046 },
47)
48
49config_setting(
50 name = "ios_armv7s",
51 values = {
Pete Wardencb392042016-02-23 10:18:32 -080052 "ios_cpu": "armv7s",
Pete Wardenf0c1a862016-03-09 13:03:52 -080053 },
54)
55
56config_setting(
57 name = "ios_arm64",
58 values = {
Pete Wardencb392042016-02-23 10:18:32 -080059 "ios_cpu": "arm64",
60 },
61)
62
63IOS_ARM_COPTS = COPTS + [
64 "-DOS_IOS",
65 "-miphoneos-version-min=7.0",
66 "-arch armv7",
67 "-arch armv7s",
68 "-arch arm64",
69 "-D__thread=",
70 "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/",
71]
72
Jisi Liud19604f2015-06-17 17:37:58 -070073cc_library(
74 name = "protobuf_lite",
75 srcs = [
76 # AUTOGEN(protobuf_lite_srcs)
77 "src/google/protobuf/arena.cc",
78 "src/google/protobuf/arenastring.cc",
79 "src/google/protobuf/extension_set.cc",
80 "src/google/protobuf/generated_message_util.cc",
81 "src/google/protobuf/io/coded_stream.cc",
82 "src/google/protobuf/io/zero_copy_stream.cc",
83 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
84 "src/google/protobuf/message_lite.cc",
85 "src/google/protobuf/repeated_field.cc",
86 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
87 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -070088 "src/google/protobuf/stubs/bytestream.cc",
Jisi Liud19604f2015-06-17 17:37:58 -070089 "src/google/protobuf/stubs/common.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -070090 "src/google/protobuf/stubs/int128.cc",
Jisi Liud19604f2015-06-17 17:37:58 -070091 "src/google/protobuf/stubs/once.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -070092 "src/google/protobuf/stubs/status.cc",
93 "src/google/protobuf/stubs/statusor.cc",
94 "src/google/protobuf/stubs/stringpiece.cc",
Jisi Liud19604f2015-06-17 17:37:58 -070095 "src/google/protobuf/stubs/stringprintf.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -070096 "src/google/protobuf/stubs/structurally_valid.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -070097 "src/google/protobuf/stubs/strutil.cc",
98 "src/google/protobuf/stubs/time.cc",
Jisi Liud19604f2015-06-17 17:37:58 -070099 "src/google/protobuf/wire_format_lite.cc",
100 ],
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800101 hdrs = glob(["src/google/protobuf/**/*.h"]),
Pete Wardencb392042016-02-23 10:18:32 -0800102 copts = select({
Pete Wardenf0c1a862016-03-09 13:03:52 -0800103 ":ios_armv7": IOS_ARM_COPTS,
104 ":ios_armv7s": IOS_ARM_COPTS,
105 ":ios_arm64": IOS_ARM_COPTS,
Pete Wardencb392042016-02-23 10:18:32 -0800106 "//conditions:default": COPTS,
107 }),
Jisi Liud19604f2015-06-17 17:37:58 -0700108 includes = ["src/"],
109 linkopts = LINK_OPTS,
110 visibility = ["//visibility:public"],
111)
112
113cc_library(
114 name = "protobuf",
115 srcs = [
116 # AUTOGEN(protobuf_srcs)
117 "src/google/protobuf/any.cc",
118 "src/google/protobuf/any.pb.cc",
119 "src/google/protobuf/api.pb.cc",
120 "src/google/protobuf/compiler/importer.cc",
121 "src/google/protobuf/compiler/parser.cc",
122 "src/google/protobuf/descriptor.cc",
123 "src/google/protobuf/descriptor.pb.cc",
124 "src/google/protobuf/descriptor_database.cc",
125 "src/google/protobuf/duration.pb.cc",
126 "src/google/protobuf/dynamic_message.cc",
127 "src/google/protobuf/empty.pb.cc",
128 "src/google/protobuf/extension_set_heavy.cc",
129 "src/google/protobuf/field_mask.pb.cc",
130 "src/google/protobuf/generated_message_reflection.cc",
131 "src/google/protobuf/io/gzip_stream.cc",
132 "src/google/protobuf/io/printer.cc",
133 "src/google/protobuf/io/strtod.cc",
134 "src/google/protobuf/io/tokenizer.cc",
135 "src/google/protobuf/io/zero_copy_stream_impl.cc",
136 "src/google/protobuf/map_field.cc",
137 "src/google/protobuf/message.cc",
138 "src/google/protobuf/reflection_ops.cc",
139 "src/google/protobuf/service.cc",
140 "src/google/protobuf/source_context.pb.cc",
141 "src/google/protobuf/struct.pb.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700142 "src/google/protobuf/stubs/mathlimits.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700143 "src/google/protobuf/stubs/substitute.cc",
144 "src/google/protobuf/text_format.cc",
145 "src/google/protobuf/timestamp.pb.cc",
146 "src/google/protobuf/type.pb.cc",
147 "src/google/protobuf/unknown_field_set.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700148 "src/google/protobuf/util/field_comparator.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700149 "src/google/protobuf/util/field_mask_util.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700150 "src/google/protobuf/util/internal/datapiece.cc",
151 "src/google/protobuf/util/internal/default_value_objectwriter.cc",
152 "src/google/protobuf/util/internal/error_listener.cc",
153 "src/google/protobuf/util/internal/field_mask_utility.cc",
154 "src/google/protobuf/util/internal/json_escaping.cc",
155 "src/google/protobuf/util/internal/json_objectwriter.cc",
156 "src/google/protobuf/util/internal/json_stream_parser.cc",
157 "src/google/protobuf/util/internal/object_writer.cc",
Feng Xiaoef6c72b2015-12-28 17:33:55 -0800158 "src/google/protobuf/util/internal/proto_writer.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700159 "src/google/protobuf/util/internal/protostream_objectsource.cc",
160 "src/google/protobuf/util/internal/protostream_objectwriter.cc",
161 "src/google/protobuf/util/internal/type_info.cc",
162 "src/google/protobuf/util/internal/type_info_test_helper.cc",
163 "src/google/protobuf/util/internal/utility.cc",
164 "src/google/protobuf/util/json_util.cc",
165 "src/google/protobuf/util/message_differencer.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700166 "src/google/protobuf/util/time_util.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700167 "src/google/protobuf/util/type_resolver_util.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700168 "src/google/protobuf/wire_format.cc",
169 "src/google/protobuf/wrappers.pb.cc",
170 ],
Lukacs T. Berki915d9cd2015-11-16 09:36:32 +0100171 hdrs = glob(["src/**/*.h"]),
Pete Wardencb392042016-02-23 10:18:32 -0800172 copts = select({
Pete Wardenf0c1a862016-03-09 13:03:52 -0800173 ":ios_armv7": IOS_ARM_COPTS,
174 ":ios_armv7s": IOS_ARM_COPTS,
175 ":ios_arm64": IOS_ARM_COPTS,
Pete Wardencb392042016-02-23 10:18:32 -0800176 "//conditions:default": COPTS,
177 }),
Jisi Liud19604f2015-06-17 17:37:58 -0700178 includes = ["src/"],
179 linkopts = LINK_OPTS,
180 visibility = ["//visibility:public"],
181 deps = [":protobuf_lite"],
182)
183
Manjunath Kudlur6837b2d2017-03-02 18:02:05 -0800184# This provides just the header files for use in projects that need to build
185# shared libraries for dynamic loading. This target is available until Bazel
186# adds native support for such use cases.
187# TODO(keveman): Remove this target once the support gets added to Bazel.
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800188cc_library(
189 name = "protobuf_headers",
190 hdrs = glob(["src/**/*.h"]),
191 includes = ["src/"],
192 visibility = ["//visibility:public"],
193)
194
Jisi Liu14c8f8a2015-10-20 15:36:22 -0700195objc_library(
196 name = "protobuf_objc",
197 hdrs = ["objectivec/GPBProtocolBuffers.h"],
198 includes = ["objectivec"],
199 non_arc_srcs = ["objectivec/GPBProtocolBuffers.m"],
200 visibility = ["//visibility:public"],
201)
Jorge Canizalesd5d7bb32015-06-28 15:23:02 -0700202
Jisi Liu993fb702015-10-19 17:19:49 -0700203RELATIVE_WELL_KNOWN_PROTOS = [
Jorge Canizalesd5d7bb32015-06-28 15:23:02 -0700204 # AUTOGEN(well_known_protos)
205 "google/protobuf/any.proto",
206 "google/protobuf/api.proto",
207 "google/protobuf/compiler/plugin.proto",
208 "google/protobuf/descriptor.proto",
209 "google/protobuf/duration.proto",
210 "google/protobuf/empty.proto",
211 "google/protobuf/field_mask.proto",
212 "google/protobuf/source_context.proto",
213 "google/protobuf/struct.proto",
214 "google/protobuf/timestamp.proto",
215 "google/protobuf/type.proto",
216 "google/protobuf/wrappers.proto",
217]
218
Jisi Liu993fb702015-10-19 17:19:49 -0700219WELL_KNOWN_PROTOS = ["src/" + s for s in RELATIVE_WELL_KNOWN_PROTOS]
220
Steven Parkesd5a57322016-03-22 17:56:07 -0700221filegroup(
222 name = "well_known_protos",
223 srcs = WELL_KNOWN_PROTOS,
224 visibility = ["//visibility:public"],
225)
226
Jisi Liu39362b32015-10-14 17:12:11 -0700227cc_proto_library(
228 name = "cc_wkt_protos",
Jisi Liu993fb702015-10-19 17:19:49 -0700229 srcs = WELL_KNOWN_PROTOS,
Jisi Liu3101e732015-10-16 12:46:26 -0700230 include = "src",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800231 default_runtime = ":protobuf",
Jisi Liu993fb702015-10-19 17:19:49 -0700232 internal_bootstrap_hack = 1,
Jisi Liu04658a32015-10-20 15:00:13 -0700233 protoc = ":protoc",
Jisi Liu6a40bf82015-11-17 12:36:21 -0800234 visibility = ["//visibility:public"],
Jisi Liu39362b32015-10-14 17:12:11 -0700235)
236
Jorge Canizalesd5d7bb32015-06-28 15:23:02 -0700237################################################################################
238# Protocol Buffers Compiler
239################################################################################
240
Adam Cozzetted1e7bd92016-12-20 09:08:19 -0800241cc_binary(
242 name = "js_embed",
243 srcs = ["src/google/protobuf/compiler/js/embed.cc"],
244 visibility = ["//visibility:public"],
245)
246
247genrule(
248 name = "generate_js_well_known_types_embed",
249 srcs = [
250 "src/google/protobuf/compiler/js/well_known_types/any.js",
251 "src/google/protobuf/compiler/js/well_known_types/struct.js",
252 "src/google/protobuf/compiler/js/well_known_types/timestamp.js",
253 ],
254 outs = ["src/google/protobuf/compiler/js/well_known_types_embed.cc"],
255 cmd = "$(location :js_embed) $(SRCS) > $@",
256 tools = [":js_embed"],
257)
258
Jisi Liud19604f2015-06-17 17:37:58 -0700259cc_library(
260 name = "protoc_lib",
261 srcs = [
262 # AUTOGEN(protoc_lib_srcs)
263 "src/google/protobuf/compiler/code_generator.cc",
264 "src/google/protobuf/compiler/command_line_interface.cc",
265 "src/google/protobuf/compiler/cpp/cpp_enum.cc",
266 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
267 "src/google/protobuf/compiler/cpp/cpp_extension.cc",
268 "src/google/protobuf/compiler/cpp/cpp_field.cc",
269 "src/google/protobuf/compiler/cpp/cpp_file.cc",
270 "src/google/protobuf/compiler/cpp/cpp_generator.cc",
271 "src/google/protobuf/compiler/cpp/cpp_helpers.cc",
272 "src/google/protobuf/compiler/cpp/cpp_map_field.cc",
273 "src/google/protobuf/compiler/cpp/cpp_message.cc",
274 "src/google/protobuf/compiler/cpp/cpp_message_field.cc",
275 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
276 "src/google/protobuf/compiler/cpp/cpp_service.cc",
277 "src/google/protobuf/compiler/cpp/cpp_string_field.cc",
Ming Zhao5cdd9362015-10-05 14:37:21 -0700278 "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700279 "src/google/protobuf/compiler/csharp/csharp_enum.cc",
280 "src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700281 "src/google/protobuf/compiler/csharp/csharp_field_base.cc",
282 "src/google/protobuf/compiler/csharp/csharp_generator.cc",
283 "src/google/protobuf/compiler/csharp/csharp_helpers.cc",
Jon Skeetb2ac8682015-07-15 13:17:42 +0100284 "src/google/protobuf/compiler/csharp/csharp_map_field.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700285 "src/google/protobuf/compiler/csharp/csharp_message.cc",
286 "src/google/protobuf/compiler/csharp/csharp_message_field.cc",
287 "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
Jon Skeeta6361a12015-11-19 13:05:17 +0000288 "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700289 "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
290 "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
291 "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
292 "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
Jon Skeetb2ac8682015-07-15 13:17:42 +0100293 "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700294 "src/google/protobuf/compiler/java/java_context.cc",
295 "src/google/protobuf/compiler/java/java_doc_comment.cc",
296 "src/google/protobuf/compiler/java/java_enum.cc",
297 "src/google/protobuf/compiler/java/java_enum_field.cc",
298 "src/google/protobuf/compiler/java/java_enum_field_lite.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700299 "src/google/protobuf/compiler/java/java_enum_lite.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700300 "src/google/protobuf/compiler/java/java_extension.cc",
Jisi Liu1f4f3e22016-04-18 14:12:08 -0700301 "src/google/protobuf/compiler/java/java_extension_lite.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700302 "src/google/protobuf/compiler/java/java_field.cc",
303 "src/google/protobuf/compiler/java/java_file.cc",
304 "src/google/protobuf/compiler/java/java_generator.cc",
305 "src/google/protobuf/compiler/java/java_generator_factory.cc",
306 "src/google/protobuf/compiler/java/java_helpers.cc",
307 "src/google/protobuf/compiler/java/java_lazy_message_field.cc",
308 "src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc",
309 "src/google/protobuf/compiler/java/java_map_field.cc",
310 "src/google/protobuf/compiler/java/java_map_field_lite.cc",
311 "src/google/protobuf/compiler/java/java_message.cc",
312 "src/google/protobuf/compiler/java/java_message_builder.cc",
313 "src/google/protobuf/compiler/java/java_message_builder_lite.cc",
314 "src/google/protobuf/compiler/java/java_message_field.cc",
315 "src/google/protobuf/compiler/java/java_message_field_lite.cc",
316 "src/google/protobuf/compiler/java/java_message_lite.cc",
317 "src/google/protobuf/compiler/java/java_name_resolver.cc",
318 "src/google/protobuf/compiler/java/java_primitive_field.cc",
319 "src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
320 "src/google/protobuf/compiler/java/java_service.cc",
321 "src/google/protobuf/compiler/java/java_shared_code_generator.cc",
322 "src/google/protobuf/compiler/java/java_string_field.cc",
323 "src/google/protobuf/compiler/java/java_string_field_lite.cc",
324 "src/google/protobuf/compiler/javanano/javanano_enum.cc",
325 "src/google/protobuf/compiler/javanano/javanano_enum_field.cc",
326 "src/google/protobuf/compiler/javanano/javanano_extension.cc",
327 "src/google/protobuf/compiler/javanano/javanano_field.cc",
328 "src/google/protobuf/compiler/javanano/javanano_file.cc",
329 "src/google/protobuf/compiler/javanano/javanano_generator.cc",
330 "src/google/protobuf/compiler/javanano/javanano_helpers.cc",
331 "src/google/protobuf/compiler/javanano/javanano_map_field.cc",
332 "src/google/protobuf/compiler/javanano/javanano_message.cc",
333 "src/google/protobuf/compiler/javanano/javanano_message_field.cc",
334 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
Feng Xiaoef6c72b2015-12-28 17:33:55 -0800335 "src/google/protobuf/compiler/js/js_generator.cc",
Jisi Liuf92b4552016-12-05 10:16:47 -0800336 "src/google/protobuf/compiler/js/well_known_types_embed.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700337 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
338 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
339 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
340 "src/google/protobuf/compiler/objectivec/objectivec_field.cc",
341 "src/google/protobuf/compiler/objectivec/objectivec_file.cc",
342 "src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
343 "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
344 "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
345 "src/google/protobuf/compiler/objectivec/objectivec_message.cc",
346 "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
347 "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
348 "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
Jisi Liud9473082016-09-22 15:14:58 -0700349 "src/google/protobuf/compiler/php/php_generator.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700350 "src/google/protobuf/compiler/plugin.cc",
351 "src/google/protobuf/compiler/plugin.pb.cc",
352 "src/google/protobuf/compiler/python/python_generator.cc",
353 "src/google/protobuf/compiler/ruby/ruby_generator.cc",
354 "src/google/protobuf/compiler/subprocess.cc",
355 "src/google/protobuf/compiler/zip_writer.cc",
356 ],
357 copts = COPTS,
358 includes = ["src/"],
359 linkopts = LINK_OPTS,
360 visibility = ["//visibility:public"],
361 deps = [":protobuf"],
362)
363
364cc_binary(
365 name = "protoc",
366 srcs = ["src/google/protobuf/compiler/main.cc"],
Jisi Liud19604f2015-06-17 17:37:58 -0700367 linkopts = LINK_OPTS,
368 visibility = ["//visibility:public"],
369 deps = [":protoc_lib"],
370)
371
Jisi Liud19604f2015-06-17 17:37:58 -0700372################################################################################
373# Tests
374################################################################################
375
Jisi Liu993fb702015-10-19 17:19:49 -0700376RELATIVE_LITE_TEST_PROTOS = [
Jisi Liud19604f2015-06-17 17:37:58 -0700377 # AUTOGEN(lite_test_protos)
378 "google/protobuf/map_lite_unittest.proto",
379 "google/protobuf/unittest_import_lite.proto",
380 "google/protobuf/unittest_import_public_lite.proto",
381 "google/protobuf/unittest_lite.proto",
Jisi Liub90f9f82015-08-25 17:06:33 -0700382 "google/protobuf/unittest_no_arena_lite.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700383]
384
Jisi Liu993fb702015-10-19 17:19:49 -0700385LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS]
386
387RELATIVE_TEST_PROTOS = [
Jisi Liud19604f2015-06-17 17:37:58 -0700388 # AUTOGEN(test_protos)
389 "google/protobuf/any_test.proto",
390 "google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto",
391 "google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto",
392 "google/protobuf/map_proto2_unittest.proto",
393 "google/protobuf/map_unittest.proto",
394 "google/protobuf/unittest.proto",
395 "google/protobuf/unittest_arena.proto",
396 "google/protobuf/unittest_custom_options.proto",
397 "google/protobuf/unittest_drop_unknown_fields.proto",
398 "google/protobuf/unittest_embed_optimize_for.proto",
399 "google/protobuf/unittest_empty.proto",
400 "google/protobuf/unittest_enormous_descriptor.proto",
401 "google/protobuf/unittest_import.proto",
402 "google/protobuf/unittest_import_public.proto",
403 "google/protobuf/unittest_lite_imports_nonlite.proto",
404 "google/protobuf/unittest_mset.proto",
Jisi Liub90f9f82015-08-25 17:06:33 -0700405 "google/protobuf/unittest_mset_wire_format.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700406 "google/protobuf/unittest_no_arena.proto",
407 "google/protobuf/unittest_no_arena_import.proto",
408 "google/protobuf/unittest_no_field_presence.proto",
409 "google/protobuf/unittest_no_generic_services.proto",
410 "google/protobuf/unittest_optimize_for.proto",
411 "google/protobuf/unittest_preserve_unknown_enum.proto",
412 "google/protobuf/unittest_preserve_unknown_enum2.proto",
413 "google/protobuf/unittest_proto3_arena.proto",
Chad Whipkeybaf52bd2016-04-15 09:23:50 -0700414 "google/protobuf/unittest_proto3_arena_lite.proto",
415 "google/protobuf/unittest_proto3_lite.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700416 "google/protobuf/unittest_well_known_types.proto",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700417 "google/protobuf/util/internal/testdata/anys.proto",
418 "google/protobuf/util/internal/testdata/books.proto",
419 "google/protobuf/util/internal/testdata/default_value.proto",
420 "google/protobuf/util/internal/testdata/default_value_test.proto",
421 "google/protobuf/util/internal/testdata/field_mask.proto",
422 "google/protobuf/util/internal/testdata/maps.proto",
Jisi Liub90f9f82015-08-25 17:06:33 -0700423 "google/protobuf/util/internal/testdata/oneofs.proto",
Jisi Liu9d4657a2016-09-22 15:11:17 -0700424 "google/protobuf/util/internal/testdata/proto3.proto",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700425 "google/protobuf/util/internal/testdata/struct.proto",
426 "google/protobuf/util/internal/testdata/timestamp_duration.proto",
Jisi Liu9d4657a2016-09-22 15:11:17 -0700427 "google/protobuf/util/internal/testdata/wrappers.proto",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700428 "google/protobuf/util/json_format_proto3.proto",
Feng Xiaoef6c72b2015-12-28 17:33:55 -0800429 "google/protobuf/util/message_differencer_unittest.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700430]
431
Jisi Liu993fb702015-10-19 17:19:49 -0700432TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS]
433
Jisi Liu39362b32015-10-14 17:12:11 -0700434cc_proto_library(
435 name = "cc_test_protos",
Jisi Liu993fb702015-10-19 17:19:49 -0700436 srcs = LITE_TEST_PROTOS + TEST_PROTOS,
Jisi Liu3101e732015-10-16 12:46:26 -0700437 include = "src",
Jisi Liube92ffb2015-10-27 15:11:38 -0700438 default_runtime = ":protobuf",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800439 protoc = ":protoc",
Jisi Liud8701b52015-10-16 11:44:21 -0700440 deps = [":cc_wkt_protos"],
Jisi Liud19604f2015-06-17 17:37:58 -0700441)
442
443COMMON_TEST_SRCS = [
444 # AUTOGEN(common_test_srcs)
445 "src/google/protobuf/arena_test_util.cc",
446 "src/google/protobuf/map_test_util.cc",
447 "src/google/protobuf/test_util.cc",
448 "src/google/protobuf/testing/file.cc",
449 "src/google/protobuf/testing/googletest.cc",
450]
451
Jisi Liu7a0c4312015-06-18 16:45:27 -0700452cc_binary(
453 name = "test_plugin",
454 srcs = [
455 # AUTOGEN(test_plugin_srcs)
456 "src/google/protobuf/compiler/mock_code_generator.cc",
457 "src/google/protobuf/compiler/test_plugin.cc",
458 "src/google/protobuf/testing/file.cc",
459 ],
460 deps = [
461 ":protobuf",
462 ":protoc_lib",
463 "//external:gtest",
464 ],
465)
466
467cc_test(
468 name = "protobuf_test",
Jisi Liu39362b32015-10-14 17:12:11 -0700469 srcs = COMMON_TEST_SRCS + [
Jisi Liu7a0c4312015-06-18 16:45:27 -0700470 # AUTOGEN(test_srcs)
471 "src/google/protobuf/any_test.cc",
472 "src/google/protobuf/arena_unittest.cc",
473 "src/google/protobuf/arenastring_unittest.cc",
474 "src/google/protobuf/compiler/command_line_interface_unittest.cc",
475 "src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc",
476 "src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc",
477 "src/google/protobuf/compiler/cpp/cpp_unittest.cc",
Jisi Liu1f4f3e22016-04-18 14:12:08 -0700478 "src/google/protobuf/compiler/cpp/metadata_test.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700479 "src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc",
480 "src/google/protobuf/compiler/importer_unittest.cc",
481 "src/google/protobuf/compiler/java/java_doc_comment_unittest.cc",
482 "src/google/protobuf/compiler/java/java_plugin_unittest.cc",
483 "src/google/protobuf/compiler/mock_code_generator.cc",
484 "src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc",
485 "src/google/protobuf/compiler/parser_unittest.cc",
486 "src/google/protobuf/compiler/python/python_plugin_unittest.cc",
487 "src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc",
488 "src/google/protobuf/descriptor_database_unittest.cc",
489 "src/google/protobuf/descriptor_unittest.cc",
490 "src/google/protobuf/drop_unknown_fields_test.cc",
491 "src/google/protobuf/dynamic_message_unittest.cc",
492 "src/google/protobuf/extension_set_unittest.cc",
493 "src/google/protobuf/generated_message_reflection_unittest.cc",
494 "src/google/protobuf/io/coded_stream_unittest.cc",
495 "src/google/protobuf/io/printer_unittest.cc",
496 "src/google/protobuf/io/tokenizer_unittest.cc",
497 "src/google/protobuf/io/zero_copy_stream_unittest.cc",
498 "src/google/protobuf/map_field_test.cc",
499 "src/google/protobuf/map_test.cc",
500 "src/google/protobuf/message_unittest.cc",
501 "src/google/protobuf/no_field_presence_test.cc",
502 "src/google/protobuf/preserve_unknown_enum_test.cc",
Chad Whipkeybaf52bd2016-04-15 09:23:50 -0700503 "src/google/protobuf/proto3_arena_lite_unittest.cc",
Jisi Liuf86d39c2016-04-28 14:43:22 -0700504 "src/google/protobuf/proto3_arena_unittest.cc",
Chad Whipkeybaf52bd2016-04-15 09:23:50 -0700505 "src/google/protobuf/proto3_lite_unittest.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700506 "src/google/protobuf/reflection_ops_unittest.cc",
507 "src/google/protobuf/repeated_field_reflection_unittest.cc",
508 "src/google/protobuf/repeated_field_unittest.cc",
509 "src/google/protobuf/stubs/bytestream_unittest.cc",
510 "src/google/protobuf/stubs/common_unittest.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700511 "src/google/protobuf/stubs/int128_unittest.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700512 "src/google/protobuf/stubs/once_unittest.cc",
513 "src/google/protobuf/stubs/status_test.cc",
514 "src/google/protobuf/stubs/statusor_test.cc",
515 "src/google/protobuf/stubs/stringpiece_unittest.cc",
516 "src/google/protobuf/stubs/stringprintf_unittest.cc",
517 "src/google/protobuf/stubs/structurally_valid_unittest.cc",
518 "src/google/protobuf/stubs/strutil_unittest.cc",
519 "src/google/protobuf/stubs/template_util_unittest.cc",
520 "src/google/protobuf/stubs/time_test.cc",
521 "src/google/protobuf/stubs/type_traits_unittest.cc",
522 "src/google/protobuf/text_format_unittest.cc",
523 "src/google/protobuf/unknown_field_set_unittest.cc",
524 "src/google/protobuf/util/field_comparator_test.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700525 "src/google/protobuf/util/field_mask_util_test.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700526 "src/google/protobuf/util/internal/default_value_objectwriter_test.cc",
527 "src/google/protobuf/util/internal/json_objectwriter_test.cc",
528 "src/google/protobuf/util/internal/json_stream_parser_test.cc",
529 "src/google/protobuf/util/internal/protostream_objectsource_test.cc",
530 "src/google/protobuf/util/internal/protostream_objectwriter_test.cc",
531 "src/google/protobuf/util/internal/type_info_test_helper.cc",
532 "src/google/protobuf/util/json_util_test.cc",
Feng Xiaoef6c72b2015-12-28 17:33:55 -0800533 "src/google/protobuf/util/message_differencer_unittest.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700534 "src/google/protobuf/util/time_util_test.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700535 "src/google/protobuf/util/type_resolver_util_test.cc",
536 "src/google/protobuf/well_known_types_unittest.cc",
537 "src/google/protobuf/wire_format_unittest.cc",
538 ],
539 copts = COPTS,
540 data = [
541 ":test_plugin",
Jisi Liu598480d2015-10-21 11:19:16 -0700542 ] + glob([
543 "src/google/protobuf/**/*",
544 ]),
Jisi Liu7a0c4312015-06-18 16:45:27 -0700545 includes = [
546 "src/",
547 ],
548 linkopts = LINK_OPTS,
549 deps = [
Jisi Liu993fb702015-10-19 17:19:49 -0700550 ":cc_test_protos",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700551 ":protobuf",
552 ":protoc_lib",
553 "//external:gtest_main",
554 ],
555)
Jisi Liu993fb702015-10-19 17:19:49 -0700556
557################################################################################
558# Java support
559################################################################################
Steven Parkesea188662016-02-25 07:53:19 -0800560internal_gen_well_known_protos_java(
Ming Zhao4fe03812016-01-21 23:03:28 -0800561 srcs = WELL_KNOWN_PROTOS,
Jisi Liu993fb702015-10-19 17:19:49 -0700562)
563
564java_library(
Jisi Liu166e9bb2015-10-21 10:56:38 -0700565 name = "protobuf_java",
Jisi Liu993fb702015-10-19 17:19:49 -0700566 srcs = glob([
Ming Zhao4fe03812016-01-21 23:03:28 -0800567 "java/core/src/main/java/com/google/protobuf/*.java",
Jisi Liu993fb702015-10-19 17:19:49 -0700568 ]) + [
Ming Zhao4fe03812016-01-21 23:03:28 -0800569 ":gen_well_known_protos_java",
Jisi Liu993fb702015-10-19 17:19:49 -0700570 ],
571 visibility = ["//visibility:public"],
572)
573
Steven Parkesa9244ca2016-03-10 17:50:25 -0800574java_library(
575 name = "protobuf_java_util",
576 srcs = glob([
577 "java/util/src/main/java/com/google/protobuf/util/*.java",
578 ]),
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800579 visibility = ["//visibility:public"],
Steven Parkesa9244ca2016-03-10 17:50:25 -0800580 deps = [
David Z. Chen5ebeefb2016-04-08 13:30:13 -0700581 "protobuf_java",
582 "//external:gson",
583 "//external:guava",
Steven Parkesa9244ca2016-03-10 17:50:25 -0800584 ],
Steven Parkesa9244ca2016-03-10 17:50:25 -0800585)
586
Jisi Liu993fb702015-10-19 17:19:49 -0700587################################################################################
588# Python support
589################################################################################
590
David Z. Chen985c9682016-02-11 18:11:10 -0800591py_library(
Jisi Liu993fb702015-10-19 17:19:49 -0700592 name = "python_srcs",
593 srcs = glob(
594 [
595 "python/google/protobuf/*.py",
596 "python/google/protobuf/**/*.py",
597 ],
598 exclude = [
David Z. Chen02cd45c2016-05-20 16:49:04 -0700599 "python/google/protobuf/__init__.py",
600 "python/google/protobuf/**/__init__.py",
Jisi Liu993fb702015-10-19 17:19:49 -0700601 "python/google/protobuf/internal/*_test.py",
602 "python/google/protobuf/internal/test_util.py",
603 ],
604 ),
David Z. Chen985c9682016-02-11 18:11:10 -0800605 imports = ["python"],
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800606 srcs_version = "PY2AND3",
Jisi Liu993fb702015-10-19 17:19:49 -0700607)
608
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800609cc_binary(
Richard Shindf5841f2016-10-18 13:16:44 -0700610 name = "python/google/protobuf/internal/_api_implementation.so",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800611 srcs = ["python/google/protobuf/internal/api_implementation.cc"],
612 copts = COPTS + [
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800613 "-DPYTHON_PROTO2_CPP_IMPL_V2",
614 ],
615 linkshared = 1,
616 linkstatic = 1,
Manjunath Kudlura1949212015-12-08 08:24:37 -0800617 deps = select({
618 "//conditions:default": [],
David Z. Chen985c9682016-02-11 18:11:10 -0800619 ":use_fast_cpp_protos": ["//external:python_headers"],
Manjunath Kudlura1949212015-12-08 08:24:37 -0800620 }),
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800621)
622
623cc_binary(
Richard Shindf5841f2016-10-18 13:16:44 -0700624 name = "python/google/protobuf/pyext/_message.so",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800625 srcs = glob([
626 "python/google/protobuf/pyext/*.cc",
627 "python/google/protobuf/pyext/*.h",
628 ]),
629 copts = COPTS + [
630 "-DGOOGLE_PROTOBUF_HAS_ONEOF=1",
Manjunath Kudlur99a3e302016-02-16 15:17:10 -0800631 ] + select({
632 "//conditions:default": [],
633 ":allow_oversize_protos": ["-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1"],
634 }),
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800635 includes = [
636 "python/",
637 "src/",
638 ],
639 linkshared = 1,
640 linkstatic = 1,
Manjunath Kudlura1949212015-12-08 08:24:37 -0800641 deps = [
642 ":protobuf",
643 ] + select({
644 "//conditions:default": [],
David Z. Chen985c9682016-02-11 18:11:10 -0800645 ":use_fast_cpp_protos": ["//external:python_headers"],
Manjunath Kudlura1949212015-12-08 08:24:37 -0800646 }),
647)
648
649config_setting(
650 name = "use_fast_cpp_protos",
651 values = {
652 "define": "use_fast_cpp_protos=true",
653 },
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800654)
655
Manjunath Kudlur99a3e302016-02-16 15:17:10 -0800656config_setting(
657 name = "allow_oversize_protos",
658 values = {
659 "define": "allow_oversize_protos=true",
660 },
661)
662
David Z. Chen02cd45c2016-05-20 16:49:04 -0700663# Copy the builtin proto files from src/google/protobuf to
664# python/google/protobuf. This way, the generated Python sources will be in the
665# same directory as the Python runtime sources. This is necessary for the
666# modules to be imported correctly since they are all part of the same Python
667# package.
668internal_copied_filegroup(
669 name = "protos_python",
670 srcs = WELL_KNOWN_PROTOS,
David Z. Chen02cd45c2016-05-20 16:49:04 -0700671 dest = "python",
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800672 strip_prefix = "src",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700673)
674
675# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
676# which case we can simply add :protos_python in srcs.
677COPIED_WELL_KNOWN_PROTOS = ["python/" + s for s in RELATIVE_WELL_KNOWN_PROTOS]
678
Jisi Liu993fb702015-10-19 17:19:49 -0700679py_proto_library(
Jisi Liu166e9bb2015-10-21 10:56:38 -0700680 name = "protobuf_python",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700681 srcs = COPIED_WELL_KNOWN_PROTOS,
682 include = "python",
Manjunath Kudlura1949212015-12-08 08:24:37 -0800683 data = select({
684 "//conditions:default": [],
685 ":use_fast_cpp_protos": [
Richard Shindf5841f2016-10-18 13:16:44 -0700686 ":python/google/protobuf/internal/_api_implementation.so",
687 ":python/google/protobuf/pyext/_message.so",
Manjunath Kudlura1949212015-12-08 08:24:37 -0800688 ],
689 }),
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800690 default_runtime = "",
Jisi Liu04658a32015-10-20 15:00:13 -0700691 protoc = ":protoc",
David Z. Chen985c9682016-02-11 18:11:10 -0800692 py_libs = [
693 ":python_srcs",
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800694 "//external:six",
David Z. Chen985c9682016-02-11 18:11:10 -0800695 ],
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800696 srcs_version = "PY2AND3",
Jisi Liu993fb702015-10-19 17:19:49 -0700697 visibility = ["//visibility:public"],
698)
699
David Z. Chen02cd45c2016-05-20 16:49:04 -0700700# Copy the test proto files from src/google/protobuf to
701# python/google/protobuf. This way, the generated Python sources will be in the
702# same directory as the Python runtime sources. This is necessary for the
703# modules to be imported correctly by the tests since they are all part of the
704# same Python package.
705internal_copied_filegroup(
706 name = "protos_python_test",
707 srcs = LITE_TEST_PROTOS + TEST_PROTOS,
David Z. Chen02cd45c2016-05-20 16:49:04 -0700708 dest = "python",
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800709 strip_prefix = "src",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700710)
711
712# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
713# which case we can simply add :protos_python_test in srcs.
714COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS]
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800715
David Z. Chen02cd45c2016-05-20 16:49:04 -0700716COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS]
717
Jisi Liu993fb702015-10-19 17:19:49 -0700718py_proto_library(
719 name = "python_common_test_protos",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700720 srcs = COPIED_LITE_TEST_PROTOS + COPIED_TEST_PROTOS,
721 include = "python",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800722 default_runtime = "",
Jisi Liu04658a32015-10-20 15:00:13 -0700723 protoc = ":protoc",
David Z. Chen5ebeefb2016-04-08 13:30:13 -0700724 srcs_version = "PY2AND3",
Jisi Liu166e9bb2015-10-21 10:56:38 -0700725 deps = [":protobuf_python"],
Jisi Liu993fb702015-10-19 17:19:49 -0700726)
727
728py_proto_library(
729 name = "python_specific_test_protos",
Jisi Liu68e13f42015-10-22 11:13:14 -0700730 srcs = glob([
731 "python/google/protobuf/internal/*.proto",
732 "python/google/protobuf/internal/import_test_package/*.proto",
733 ]),
Jisi Liu993fb702015-10-19 17:19:49 -0700734 include = "python",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800735 default_runtime = ":protobuf_python",
Jisi Liu04658a32015-10-20 15:00:13 -0700736 protoc = ":protoc",
David Z. Chen5ebeefb2016-04-08 13:30:13 -0700737 srcs_version = "PY2AND3",
Jisi Liu993fb702015-10-19 17:19:49 -0700738 deps = [":python_common_test_protos"],
739)
740
741py_library(
742 name = "python_tests",
David Z. Chen985c9682016-02-11 18:11:10 -0800743 srcs = glob(
744 [
745 "python/google/protobuf/internal/*_test.py",
746 "python/google/protobuf/internal/test_util.py",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700747 "python/google/protobuf/internal/import_test_package/__init__.py",
David Z. Chen985c9682016-02-11 18:11:10 -0800748 ],
749 ),
750 imports = ["python"],
Geoffrey Irving29799232015-12-03 13:11:19 -0800751 srcs_version = "PY2AND3",
Jisi Liu993fb702015-10-19 17:19:49 -0700752 deps = [
Jisi Liu166e9bb2015-10-21 10:56:38 -0700753 ":protobuf_python",
Jisi Liu598480d2015-10-21 11:19:16 -0700754 ":python_common_test_protos",
Jisi Liu993fb702015-10-19 17:19:49 -0700755 ":python_specific_test_protos",
756 ],
757)
758
759internal_protobuf_py_tests(
Jisi Liu8f540262015-10-20 16:21:41 -0700760 name = "python_tests_batch",
Jisi Liu68e13f42015-10-22 11:13:14 -0700761 data = glob([
762 "src/google/protobuf/**/*",
763 ]),
Jisi Liu993fb702015-10-19 17:19:49 -0700764 modules = [
765 "descriptor_database_test",
766 "descriptor_pool_test",
767 "descriptor_test",
768 "generator_test",
769 "json_format_test",
770 "message_factory_test",
Jisi Liu68e13f42015-10-22 11:13:14 -0700771 "message_test",
Jisi Liu993fb702015-10-19 17:19:49 -0700772 "proto_builder_test",
Jisi Liu68e13f42015-10-22 11:13:14 -0700773 "reflection_test",
Jisi Liu993fb702015-10-19 17:19:49 -0700774 "service_reflection_test",
775 "symbol_database_test",
776 "text_encoding_test",
Jisi Liu68e13f42015-10-22 11:13:14 -0700777 "text_format_test",
Jisi Liu993fb702015-10-19 17:19:49 -0700778 "unknown_fields_test",
779 "wire_format_test",
780 ],
781 deps = [":python_tests"],
782)
cgrushko45d92ae2016-12-02 19:40:50 -0500783
784proto_lang_toolchain(
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800785 name = "cc_toolchain",
786 command_line = "--cpp_out=$(OUT)",
787 runtime = ":protobuf",
788 visibility = ["//visibility:public"],
cgrushko45d92ae2016-12-02 19:40:50 -0500789)
cgrushkoe4baf3f2017-01-12 12:51:04 -0500790
791proto_lang_toolchain(
792 name = "java_toolchain",
793 command_line = "--java_out=$(OUT)",
794 runtime = ":protobuf_java",
795 visibility = ["//visibility:public"],
796)