blob: 1124321602b509b1cec561a06d75064c61fd8ed0 [file] [log] [blame]
Laszlo Csomor55171682017-12-01 12:05:32 +01001# Bazel (https://bazel.build/) BUILD file for Protobuf.
Jisi Liud19604f2015-06-17 17:37:58 -07002
Yannic2e51ad62020-03-03 00:15:22 +01003load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
Yannic948740b2020-01-15 19:27:35 +01004load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library")
Yannic Bonenberger6e899192019-07-23 16:28:57 +02005load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
Yannic Bonenbergerd2d6ff52019-08-06 21:12:06 +02006load("@rules_python//python:defs.bzl", "py_library")
Yannic948740b2020-01-15 19:27:35 +01007load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test")
Yannic Bonenberger6e899192019-07-23 16:28:57 +02008
Jisi Liud19604f2015-06-17 17:37:58 -07009licenses(["notice"])
10
Piotr Sikorafaea19c2016-08-04 15:32:14 -070011exports_files(["LICENSE"])
12
Jorge Canizalesd5d7bb32015-06-28 15:23:02 -070013################################################################################
Yannic2e51ad62020-03-03 00:15:22 +010014# build configuration
15################################################################################
16
Joshua Habermande371232020-10-21 10:04:14 -070017# TODO(yannic): Remove in 3.14.0.
Yannic2e51ad62020-03-03 00:15:22 +010018string_flag(
19 name = "incompatible_use_com_google_googletest",
Joshua Habermande371232020-10-21 10:04:14 -070020 build_setting_default = "true",
Yannic2e51ad62020-03-03 00:15:22 +010021 values = ["true", "false"]
22)
23
24config_setting(
25 name = "use_com_google_googletest",
26 flag_values = {
27 "//:incompatible_use_com_google_googletest": "true"
28 },
29)
30
31GTEST = select({
32 "//:use_com_google_googletest": [
33 "@com_google_googletest//:gtest",
34 ],
35 "//conditions:default": [
36 "//external:gtest",
37 ],
38})
39
40GTEST_MAIN = select({
41 "//:use_com_google_googletest": [
42 "@com_google_googletest//:gtest_main",
43 ],
44 "//conditions:default": [
45 "//external:gtest_main",
46 ],
47})
48
49################################################################################
Cody Schroeder802d5432018-12-11 11:58:26 -080050# ZLIB configuration
51################################################################################
52
Nic McDonaldf313b9c2019-04-12 15:41:08 -070053ZLIB_DEPS = ["@zlib//:zlib"]
Cody Schroeder802d5432018-12-11 11:58:26 -080054
55################################################################################
Jorge Canizalesd5d7bb32015-06-28 15:23:02 -070056# Protobuf Runtime Library
57################################################################################
58
Pascal Muetscharda6957f22018-03-22 13:14:10 -070059MSVC_COPTS = [
Yun Peng0b059a32017-05-31 14:01:23 +020060 "/DHAVE_PTHREAD",
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -070061 "/wd4018", # -Wno-sign-compare
62 "/wd4065", # switch statement contains 'default' but no 'case' labels
63 "/wd4146", # unary minus operator applied to unsigned type, result still unsigned
64 "/wd4244", # 'conversion' conversion from 'type1' to 'type2', possible loss of data
65 "/wd4251", # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
66 "/wd4267", # 'var' : conversion from 'size_t' to 'type', possible loss of data
67 "/wd4305", # 'identifier' : truncation from 'type1' to 'type2'
68 "/wd4307", # 'operator' : integral constant overflow
69 "/wd4309", # 'conversion' : truncation of constant value
70 "/wd4334", # 'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
71 "/wd4355", # 'this' : used in base member initializer list
72 "/wd4506", # no definition for inline function 'function'
73 "/wd4514", # -Wno-unused-function
74 "/wd4800", # 'type' : forcing value to bool 'true' or 'false' (performance warning)
75 "/wd4996", # The compiler encountered a deprecated declaration.
Jisi Liud19604f2015-06-17 17:37:58 -070076]
77
Yun Peng0b059a32017-05-31 14:01:23 +020078COPTS = select({
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -070079 ":msvc": MSVC_COPTS,
Yun Peng0b059a32017-05-31 14:01:23 +020080 "//conditions:default": [
81 "-DHAVE_PTHREAD",
Cody Schroeder802d5432018-12-11 11:58:26 -080082 "-DHAVE_ZLIB",
Yun Peng0b059a32017-05-31 14:01:23 +020083 "-Woverloaded-virtual",
84 "-Wno-sign-compare",
85 "-Wno-unused-function",
Justine Tunneyac5371d2017-11-17 18:27:39 -080086 # Prevents ISO C++ const string assignment warnings for pyext sources.
depristo2506cf52018-06-28 22:54:43 +000087 "-Wno-write-strings",
Adam Cozzettef4ceaec2019-09-04 11:20:45 -070088 "-Wno-deprecated-declarations",
Yun Peng0b059a32017-05-31 14:01:23 +020089 ],
90})
91
scentinib30ddee2018-08-28 14:07:55 +020092load(":compiler_config_setting.bzl", "create_compiler_config_setting")
93
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -070094create_compiler_config_setting(
Pascal Muetscharda6957f22018-03-22 13:14:10 -070095 name = "msvc",
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -070096 value = "msvc-cl",
Yannicf0cb9cd2020-02-13 22:04:14 +010097 visibility = [
98 # Public, but Protobuf only visibility.
99 "//:__subpackages__",
100 ],
Yun Peng0b059a32017-05-31 14:01:23 +0200101)
102
Andrew Harpb56b4612016-04-04 15:13:30 -0400103config_setting(
104 name = "android",
105 values = {
106 "crosstool_top": "//external:android/crosstool",
107 },
Yannicf0cb9cd2020-02-13 22:04:14 +0100108 visibility = [
109 # Public, but Protobuf only visibility.
110 "//:__subpackages__",
111 ],
Andrew Harpb56b4612016-04-04 15:13:30 -0400112)
113
yejianwudf4ec8a2019-04-02 20:08:37 +0800114config_setting(
115 name = "android-libcpp",
116 values = {
117 "crosstool_top": "@androidndk//:toolchain-libcpp",
118 },
Yannicf0cb9cd2020-02-13 22:04:14 +0100119 visibility = [
120 # Public, but Protobuf only visibility.
121 "//:__subpackages__",
122 ],
yejianwudf4ec8a2019-04-02 20:08:37 +0800123)
124
125config_setting(
126 name = "android-gnu-libstdcpp",
127 values = {
128 "crosstool_top": "@androidndk//:toolchain-gnu-libstdcpp",
129 },
Yannicf0cb9cd2020-02-13 22:04:14 +0100130 visibility = [
131 # Public, but Protobuf only visibility.
132 "//:__subpackages__",
133 ],
yejianwudf4ec8a2019-04-02 20:08:37 +0800134)
135
Pascal Muetscharda6957f22018-03-22 13:14:10 -0700136# Android and MSVC builds do not need to link in a separate pthread library.
Andrew Harpb56b4612016-04-04 15:13:30 -0400137LINK_OPTS = select({
Andrew Harp3b4e7dc2016-04-04 16:13:31 -0400138 ":android": [],
yejianwudf4ec8a2019-04-02 20:08:37 +0800139 ":android-libcpp": [],
140 ":android-gnu-libstdcpp": [],
Jan Tattermuschccc56a32018-05-24 09:51:53 -0700141 ":msvc": [
Loo Rong Jie0456e262018-06-06 10:03:25 +0800142 # Suppress linker warnings about files with no symbols defined.
143 "-ignore:4221",
Laszlo Csomor55171682017-12-01 12:05:32 +0100144 ],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700145 "//conditions:default": [
146 "-lpthread",
147 "-lm",
148 ],
Andrew Harpb56b4612016-04-04 15:13:30 -0400149})
Jisi Liud19604f2015-06-17 17:37:58 -0700150
Jisi Liu04658a32015-10-20 15:00:13 -0700151load(
cgrushko65a4d202017-02-08 15:23:57 -0500152 ":protobuf.bzl",
Yannic Bonenberger723a85f2020-02-15 13:26:56 +0100153 "adapt_proto_library",
Jisi Liu04658a32015-10-20 15:00:13 -0700154 "cc_proto_library",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700155 "internal_copied_filegroup",
Steven Parkesea188662016-02-25 07:53:19 -0800156 "internal_gen_well_known_protos_java",
Jisi Liu04658a32015-10-20 15:00:13 -0700157 "internal_protobuf_py_tests",
Yannic Bonenberger49794892019-07-20 12:49:03 +0200158 "py_proto_library",
Jisi Liu04658a32015-10-20 15:00:13 -0700159)
Jisi Liu39362b32015-10-14 17:12:11 -0700160
Jisi Liud19604f2015-06-17 17:37:58 -0700161cc_library(
162 name = "protobuf_lite",
163 srcs = [
164 # AUTOGEN(protobuf_lite_srcs)
Phillipp Schoppmann8e5b2f12019-03-14 10:35:05 +0000165 "src/google/protobuf/any_lite.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700166 "src/google/protobuf/arena.cc",
Joshua Habermana633ad42020-09-28 12:19:39 -0700167 "src/google/protobuf/arenastring.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700168 "src/google/protobuf/extension_set.cc",
Hao Nguyen4cebf972019-05-03 15:08:01 -0700169 "src/google/protobuf/generated_enum_util.cc",
Jisi Liu12c186f2017-07-25 14:38:00 -0700170 "src/google/protobuf/generated_message_table_driven_lite.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700171 "src/google/protobuf/generated_message_util.cc",
Adam Cozzette609d7522017-12-07 14:16:50 -0800172 "src/google/protobuf/implicit_weak_message.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700173 "src/google/protobuf/io/coded_stream.cc",
Hao Nguyenef1e8e72019-04-09 06:48:01 -0700174 "src/google/protobuf/io/io_win32.cc",
John W. Bruce21e4b1c2019-06-05 18:28:16 -0700175 "src/google/protobuf/io/strtod.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700176 "src/google/protobuf/io/zero_copy_stream.cc",
Hao Nguyen4cebf972019-05-03 15:08:01 -0700177 "src/google/protobuf/io/zero_copy_stream_impl.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700178 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
Joshua Habermanb3cdd402020-08-17 17:12:44 -0700179 "src/google/protobuf/map.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700180 "src/google/protobuf/message_lite.cc",
Phillipp Schoppmann8e5b2f12019-03-14 10:35:05 +0000181 "src/google/protobuf/parse_context.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700182 "src/google/protobuf/repeated_field.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700183 "src/google/protobuf/stubs/bytestream.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700184 "src/google/protobuf/stubs/common.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700185 "src/google/protobuf/stubs/int128.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700186 "src/google/protobuf/stubs/status.cc",
187 "src/google/protobuf/stubs/statusor.cc",
188 "src/google/protobuf/stubs/stringpiece.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700189 "src/google/protobuf/stubs/stringprintf.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700190 "src/google/protobuf/stubs/structurally_valid.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700191 "src/google/protobuf/stubs/strutil.cc",
192 "src/google/protobuf/stubs/time.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700193 "src/google/protobuf/wire_format_lite.cc",
194 ],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700195 hdrs = glob([
196 "src/google/protobuf/**/*.h",
197 "src/google/protobuf/**/*.inc",
198 ]),
Param Reddy16792c62017-10-15 13:06:58 -0700199 copts = COPTS,
Jisi Liud19604f2015-06-17 17:37:58 -0700200 includes = ["src/"],
201 linkopts = LINK_OPTS,
202 visibility = ["//visibility:public"],
203)
204
Cody Schroeder802d5432018-12-11 11:58:26 -0800205PROTOBUF_DEPS = select({
206 ":msvc": [],
207 "//conditions:default": ZLIB_DEPS,
208})
209
Jisi Liud19604f2015-06-17 17:37:58 -0700210cc_library(
211 name = "protobuf",
212 srcs = [
213 # AUTOGEN(protobuf_srcs)
214 "src/google/protobuf/any.cc",
215 "src/google/protobuf/any.pb.cc",
216 "src/google/protobuf/api.pb.cc",
217 "src/google/protobuf/compiler/importer.cc",
218 "src/google/protobuf/compiler/parser.cc",
219 "src/google/protobuf/descriptor.cc",
220 "src/google/protobuf/descriptor.pb.cc",
221 "src/google/protobuf/descriptor_database.cc",
222 "src/google/protobuf/duration.pb.cc",
223 "src/google/protobuf/dynamic_message.cc",
224 "src/google/protobuf/empty.pb.cc",
225 "src/google/protobuf/extension_set_heavy.cc",
226 "src/google/protobuf/field_mask.pb.cc",
227 "src/google/protobuf/generated_message_reflection.cc",
Jisi Liu759245a2017-07-25 11:52:33 -0700228 "src/google/protobuf/generated_message_table_driven.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700229 "src/google/protobuf/io/gzip_stream.cc",
230 "src/google/protobuf/io/printer.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700231 "src/google/protobuf/io/tokenizer.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700232 "src/google/protobuf/map_field.cc",
233 "src/google/protobuf/message.cc",
234 "src/google/protobuf/reflection_ops.cc",
235 "src/google/protobuf/service.cc",
236 "src/google/protobuf/source_context.pb.cc",
237 "src/google/protobuf/struct.pb.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700238 "src/google/protobuf/stubs/substitute.cc",
239 "src/google/protobuf/text_format.cc",
240 "src/google/protobuf/timestamp.pb.cc",
241 "src/google/protobuf/type.pb.cc",
242 "src/google/protobuf/unknown_field_set.cc",
Bairen Yi312e2db2017-03-21 03:52:37 +0800243 "src/google/protobuf/util/delimited_message_util.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700244 "src/google/protobuf/util/field_comparator.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700245 "src/google/protobuf/util/field_mask_util.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700246 "src/google/protobuf/util/internal/datapiece.cc",
247 "src/google/protobuf/util/internal/default_value_objectwriter.cc",
248 "src/google/protobuf/util/internal/error_listener.cc",
249 "src/google/protobuf/util/internal/field_mask_utility.cc",
250 "src/google/protobuf/util/internal/json_escaping.cc",
251 "src/google/protobuf/util/internal/json_objectwriter.cc",
252 "src/google/protobuf/util/internal/json_stream_parser.cc",
253 "src/google/protobuf/util/internal/object_writer.cc",
Feng Xiaoef6c72b2015-12-28 17:33:55 -0800254 "src/google/protobuf/util/internal/proto_writer.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700255 "src/google/protobuf/util/internal/protostream_objectsource.cc",
256 "src/google/protobuf/util/internal/protostream_objectwriter.cc",
257 "src/google/protobuf/util/internal/type_info.cc",
258 "src/google/protobuf/util/internal/type_info_test_helper.cc",
259 "src/google/protobuf/util/internal/utility.cc",
260 "src/google/protobuf/util/json_util.cc",
261 "src/google/protobuf/util/message_differencer.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700262 "src/google/protobuf/util/time_util.cc",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700263 "src/google/protobuf/util/type_resolver_util.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700264 "src/google/protobuf/wire_format.cc",
265 "src/google/protobuf/wrappers.pb.cc",
266 ],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700267 hdrs = glob([
268 "src/**/*.h",
269 "src/**/*.inc",
270 ]),
Param Reddy16792c62017-10-15 13:06:58 -0700271 copts = COPTS,
Jisi Liud19604f2015-06-17 17:37:58 -0700272 includes = ["src/"],
273 linkopts = LINK_OPTS,
274 visibility = ["//visibility:public"],
Cody Schroeder802d5432018-12-11 11:58:26 -0800275 deps = [":protobuf_lite"] + PROTOBUF_DEPS,
Jisi Liud19604f2015-06-17 17:37:58 -0700276)
277
Manjunath Kudlur6837b2d2017-03-02 18:02:05 -0800278# This provides just the header files for use in projects that need to build
279# shared libraries for dynamic loading. This target is available until Bazel
280# adds native support for such use cases.
281# TODO(keveman): Remove this target once the support gets added to Bazel.
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800282cc_library(
283 name = "protobuf_headers",
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700284 hdrs = glob([
285 "src/**/*.h",
286 "src/**/*.inc",
287 ]),
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800288 includes = ["src/"],
289 visibility = ["//visibility:public"],
290)
291
Jakob Buchgraber699c0eb2017-09-05 17:15:10 +0200292# Map of all well known protos.
293# name => (include path, imports)
294WELL_KNOWN_PROTO_MAP = {
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200295 "any": ("src/google/protobuf/any.proto", []),
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700296 "api": (
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200297 "src/google/protobuf/api.proto",
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700298 [
299 "source_context",
300 "type",
301 ],
302 ),
303 "compiler_plugin": (
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200304 "src/google/protobuf/compiler/plugin.proto",
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700305 ["descriptor"],
306 ),
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200307 "descriptor": ("src/google/protobuf/descriptor.proto", []),
308 "duration": ("src/google/protobuf/duration.proto", []),
309 "empty": ("src/google/protobuf/empty.proto", []),
310 "field_mask": ("src/google/protobuf/field_mask.proto", []),
311 "source_context": ("src/google/protobuf/source_context.proto", []),
312 "struct": ("src/google/protobuf/struct.proto", []),
313 "timestamp": ("src/google/protobuf/timestamp.proto", []),
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700314 "type": (
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200315 "src/google/protobuf/type.proto",
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700316 [
317 "any",
318 "source_context",
319 ],
320 ),
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200321 "wrappers": ("src/google/protobuf/wrappers.proto", []),
Jakob Buchgraber699c0eb2017-09-05 17:15:10 +0200322}
323
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200324WELL_KNOWN_PROTOS = [value[0] for value in WELL_KNOWN_PROTO_MAP.values()]
Jisi Liu993fb702015-10-19 17:19:49 -0700325
Steven Parkesd5a57322016-03-22 17:56:07 -0700326filegroup(
327 name = "well_known_protos",
328 srcs = WELL_KNOWN_PROTOS,
329 visibility = ["//visibility:public"],
330)
331
Yannic Bonenberger723a85f2020-02-15 13:26:56 +0100332adapt_proto_library(
333 name = "cc_wkt_protos_genproto",
334 deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
335 visibility = ["//visibility:public"],
336)
337
338cc_library(
Jisi Liu39362b32015-10-14 17:12:11 -0700339 name = "cc_wkt_protos",
Yannic Bonenberger723a85f2020-02-15 13:26:56 +0100340 deprecation = "Only for backward compatibility. Do not use.",
Jisi Liu6a40bf82015-11-17 12:36:21 -0800341 visibility = ["//visibility:public"],
Jisi Liu39362b32015-10-14 17:12:11 -0700342)
343
Jorge Canizalesd5d7bb32015-06-28 15:23:02 -0700344################################################################################
Jakob Buchgraber699c0eb2017-09-05 17:15:10 +0200345# Well Known Types Proto Library Rules
346#
347# These proto_library rules can be used with one of the language specific proto
348# library rules i.e. java_proto_library:
349#
350# java_proto_library(
351# name = "any_java_proto",
352# deps = ["@com_google_protobuf//:any_proto],
353# )
354################################################################################
355
Jakob Buchgraber699c0eb2017-09-05 17:15:10 +0200356[proto_library(
357 name = proto[0] + "_proto",
358 srcs = [proto[1][0]],
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200359 strip_import_prefix = "src",
Jakob Buchgraber699c0eb2017-09-05 17:15:10 +0200360 visibility = ["//visibility:public"],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700361 deps = [dep + "_proto" for dep in proto[1][1]],
362) for proto in WELL_KNOWN_PROTO_MAP.items()]
Jakob Buchgraber699c0eb2017-09-05 17:15:10 +0200363
Yannic948740b2020-01-15 19:27:35 +0100364[native_cc_proto_library(
365 name = proto + "_cc_proto",
366 deps = [proto + "_proto"],
367 visibility = ["//visibility:private"],
368) for proto in WELL_KNOWN_PROTO_MAP.keys()]
369
370cc_proto_blacklist_test(
371 name = "cc_proto_blacklist_test",
Joshua Habermande371232020-10-21 10:04:14 -0700372 deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
373 tags = [
374 # Exclude this target from wildcard expansion (//...). Due to
375 # https://github.com/bazelbuild/bazel/issues/10590, this test has to
376 # be nominated using the `@com_google_protobuf//` prefix. We do that,
377 # e.g., in kokoro/linux/bazel/build.sh.
378 # See also https://github.com/protocolbuffers/protobuf/pull/7096.
379 "manual",
380 ],
Yannic948740b2020-01-15 19:27:35 +0100381)
382
Jakob Buchgraber699c0eb2017-09-05 17:15:10 +0200383################################################################################
Jorge Canizalesd5d7bb32015-06-28 15:23:02 -0700384# Protocol Buffers Compiler
385################################################################################
386
Jisi Liud19604f2015-06-17 17:37:58 -0700387cc_library(
388 name = "protoc_lib",
389 srcs = [
390 # AUTOGEN(protoc_lib_srcs)
391 "src/google/protobuf/compiler/code_generator.cc",
392 "src/google/protobuf/compiler/command_line_interface.cc",
393 "src/google/protobuf/compiler/cpp/cpp_enum.cc",
394 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
395 "src/google/protobuf/compiler/cpp/cpp_extension.cc",
396 "src/google/protobuf/compiler/cpp/cpp_field.cc",
397 "src/google/protobuf/compiler/cpp/cpp_file.cc",
398 "src/google/protobuf/compiler/cpp/cpp_generator.cc",
399 "src/google/protobuf/compiler/cpp/cpp_helpers.cc",
400 "src/google/protobuf/compiler/cpp/cpp_map_field.cc",
401 "src/google/protobuf/compiler/cpp/cpp_message.cc",
402 "src/google/protobuf/compiler/cpp/cpp_message_field.cc",
Adam Cozzette13fd0452017-09-12 10:32:01 -0700403 "src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700404 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
405 "src/google/protobuf/compiler/cpp/cpp_service.cc",
406 "src/google/protobuf/compiler/cpp/cpp_string_field.cc",
Ming Zhao5cdd9362015-10-05 14:37:21 -0700407 "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700408 "src/google/protobuf/compiler/csharp/csharp_enum.cc",
409 "src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700410 "src/google/protobuf/compiler/csharp/csharp_field_base.cc",
411 "src/google/protobuf/compiler/csharp/csharp_generator.cc",
412 "src/google/protobuf/compiler/csharp/csharp_helpers.cc",
Jon Skeetb2ac8682015-07-15 13:17:42 +0100413 "src/google/protobuf/compiler/csharp/csharp_map_field.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700414 "src/google/protobuf/compiler/csharp/csharp_message.cc",
415 "src/google/protobuf/compiler/csharp/csharp_message_field.cc",
416 "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
Jon Skeeta6361a12015-11-19 13:05:17 +0000417 "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700418 "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
419 "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
420 "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
421 "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
Jon Skeetb2ac8682015-07-15 13:17:42 +0100422 "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700423 "src/google/protobuf/compiler/java/java_context.cc",
424 "src/google/protobuf/compiler/java/java_doc_comment.cc",
425 "src/google/protobuf/compiler/java/java_enum.cc",
426 "src/google/protobuf/compiler/java/java_enum_field.cc",
427 "src/google/protobuf/compiler/java/java_enum_field_lite.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700428 "src/google/protobuf/compiler/java/java_enum_lite.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700429 "src/google/protobuf/compiler/java/java_extension.cc",
Jisi Liu1f4f3e22016-04-18 14:12:08 -0700430 "src/google/protobuf/compiler/java/java_extension_lite.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700431 "src/google/protobuf/compiler/java/java_field.cc",
432 "src/google/protobuf/compiler/java/java_file.cc",
433 "src/google/protobuf/compiler/java/java_generator.cc",
434 "src/google/protobuf/compiler/java/java_generator_factory.cc",
435 "src/google/protobuf/compiler/java/java_helpers.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700436 "src/google/protobuf/compiler/java/java_map_field.cc",
437 "src/google/protobuf/compiler/java/java_map_field_lite.cc",
438 "src/google/protobuf/compiler/java/java_message.cc",
439 "src/google/protobuf/compiler/java/java_message_builder.cc",
440 "src/google/protobuf/compiler/java/java_message_builder_lite.cc",
441 "src/google/protobuf/compiler/java/java_message_field.cc",
442 "src/google/protobuf/compiler/java/java_message_field_lite.cc",
443 "src/google/protobuf/compiler/java/java_message_lite.cc",
444 "src/google/protobuf/compiler/java/java_name_resolver.cc",
445 "src/google/protobuf/compiler/java/java_primitive_field.cc",
446 "src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
447 "src/google/protobuf/compiler/java/java_service.cc",
448 "src/google/protobuf/compiler/java/java_shared_code_generator.cc",
449 "src/google/protobuf/compiler/java/java_string_field.cc",
450 "src/google/protobuf/compiler/java/java_string_field_lite.cc",
Feng Xiaoef6c72b2015-12-28 17:33:55 -0800451 "src/google/protobuf/compiler/js/js_generator.cc",
Jisi Liuf92b4552016-12-05 10:16:47 -0800452 "src/google/protobuf/compiler/js/well_known_types_embed.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700453 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
454 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
455 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
456 "src/google/protobuf/compiler/objectivec/objectivec_field.cc",
457 "src/google/protobuf/compiler/objectivec/objectivec_file.cc",
458 "src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
459 "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
460 "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
461 "src/google/protobuf/compiler/objectivec/objectivec_message.cc",
462 "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
463 "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
464 "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
Jisi Liud9473082016-09-22 15:14:58 -0700465 "src/google/protobuf/compiler/php/php_generator.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700466 "src/google/protobuf/compiler/plugin.cc",
Feng Xiaofd595fc2018-03-01 16:36:05 -0800467 "src/google/protobuf/compiler/plugin.pb.cc",
Jisi Liud19604f2015-06-17 17:37:58 -0700468 "src/google/protobuf/compiler/python/python_generator.cc",
469 "src/google/protobuf/compiler/ruby/ruby_generator.cc",
470 "src/google/protobuf/compiler/subprocess.cc",
471 "src/google/protobuf/compiler/zip_writer.cc",
472 ],
473 copts = COPTS,
474 includes = ["src/"],
Laszlo Csomor414a6252018-08-14 16:01:24 +0200475 linkopts = LINK_OPTS,
Jisi Liud19604f2015-06-17 17:37:58 -0700476 visibility = ["//visibility:public"],
477 deps = [":protobuf"],
478)
479
480cc_binary(
481 name = "protoc",
482 srcs = ["src/google/protobuf/compiler/main.cc"],
Jisi Liud19604f2015-06-17 17:37:58 -0700483 linkopts = LINK_OPTS,
484 visibility = ["//visibility:public"],
485 deps = [":protoc_lib"],
486)
487
Jisi Liud19604f2015-06-17 17:37:58 -0700488################################################################################
489# Tests
490################################################################################
491
Jisi Liu993fb702015-10-19 17:19:49 -0700492RELATIVE_LITE_TEST_PROTOS = [
Jisi Liud19604f2015-06-17 17:37:58 -0700493 # AUTOGEN(lite_test_protos)
494 "google/protobuf/map_lite_unittest.proto",
495 "google/protobuf/unittest_import_lite.proto",
496 "google/protobuf/unittest_import_public_lite.proto",
497 "google/protobuf/unittest_lite.proto",
498]
499
Jisi Liu993fb702015-10-19 17:19:49 -0700500LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS]
501
502RELATIVE_TEST_PROTOS = [
Jisi Liud19604f2015-06-17 17:37:58 -0700503 # AUTOGEN(test_protos)
504 "google/protobuf/any_test.proto",
505 "google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto",
506 "google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto",
507 "google/protobuf/map_proto2_unittest.proto",
508 "google/protobuf/map_unittest.proto",
509 "google/protobuf/unittest.proto",
510 "google/protobuf/unittest_arena.proto",
511 "google/protobuf/unittest_custom_options.proto",
512 "google/protobuf/unittest_drop_unknown_fields.proto",
513 "google/protobuf/unittest_embed_optimize_for.proto",
514 "google/protobuf/unittest_empty.proto",
515 "google/protobuf/unittest_enormous_descriptor.proto",
516 "google/protobuf/unittest_import.proto",
517 "google/protobuf/unittest_import_public.proto",
Feng Xiao32d78302017-03-29 14:01:40 -0700518 "google/protobuf/unittest_lazy_dependencies.proto",
519 "google/protobuf/unittest_lazy_dependencies_custom_option.proto",
520 "google/protobuf/unittest_lazy_dependencies_enum.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700521 "google/protobuf/unittest_lite_imports_nonlite.proto",
522 "google/protobuf/unittest_mset.proto",
Jisi Liub90f9f82015-08-25 17:06:33 -0700523 "google/protobuf/unittest_mset_wire_format.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700524 "google/protobuf/unittest_no_field_presence.proto",
525 "google/protobuf/unittest_no_generic_services.proto",
526 "google/protobuf/unittest_optimize_for.proto",
527 "google/protobuf/unittest_preserve_unknown_enum.proto",
528 "google/protobuf/unittest_preserve_unknown_enum2.proto",
Feng Xiaobde4eaf2018-08-13 12:58:55 -0700529 "google/protobuf/unittest_proto3.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700530 "google/protobuf/unittest_proto3_arena.proto",
Chad Whipkeybaf52bd2016-04-15 09:23:50 -0700531 "google/protobuf/unittest_proto3_arena_lite.proto",
532 "google/protobuf/unittest_proto3_lite.proto",
Joshua Haberman24355892020-03-31 17:31:32 -0700533 "google/protobuf/unittest_proto3_optional.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700534 "google/protobuf/unittest_well_known_types.proto",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700535 "google/protobuf/util/internal/testdata/anys.proto",
536 "google/protobuf/util/internal/testdata/books.proto",
537 "google/protobuf/util/internal/testdata/default_value.proto",
538 "google/protobuf/util/internal/testdata/default_value_test.proto",
539 "google/protobuf/util/internal/testdata/field_mask.proto",
540 "google/protobuf/util/internal/testdata/maps.proto",
Jisi Liub90f9f82015-08-25 17:06:33 -0700541 "google/protobuf/util/internal/testdata/oneofs.proto",
Jisi Liu9d4657a2016-09-22 15:11:17 -0700542 "google/protobuf/util/internal/testdata/proto3.proto",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700543 "google/protobuf/util/internal/testdata/struct.proto",
544 "google/protobuf/util/internal/testdata/timestamp_duration.proto",
Jisi Liu9d4657a2016-09-22 15:11:17 -0700545 "google/protobuf/util/internal/testdata/wrappers.proto",
Feng Xiaobde4eaf2018-08-13 12:58:55 -0700546 "google/protobuf/util/json_format.proto",
Jisi Liuaf3eafd2015-06-18 13:38:36 -0700547 "google/protobuf/util/json_format_proto3.proto",
Feng Xiaoef6c72b2015-12-28 17:33:55 -0800548 "google/protobuf/util/message_differencer_unittest.proto",
Jisi Liud19604f2015-06-17 17:37:58 -0700549]
550
Jisi Liu993fb702015-10-19 17:19:49 -0700551TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS]
552
Jisi Liu39362b32015-10-14 17:12:11 -0700553cc_proto_library(
554 name = "cc_test_protos",
Jisi Liu993fb702015-10-19 17:19:49 -0700555 srcs = LITE_TEST_PROTOS + TEST_PROTOS,
Jisi Liu3101e732015-10-16 12:46:26 -0700556 include = "src",
Jisi Liube92ffb2015-10-27 15:11:38 -0700557 default_runtime = ":protobuf",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800558 protoc = ":protoc",
Jisi Liud8701b52015-10-16 11:44:21 -0700559 deps = [":cc_wkt_protos"],
Jisi Liud19604f2015-06-17 17:37:58 -0700560)
561
562COMMON_TEST_SRCS = [
563 # AUTOGEN(common_test_srcs)
564 "src/google/protobuf/arena_test_util.cc",
Yannic Bonenberger49794892019-07-20 12:49:03 +0200565 "src/google/protobuf/map_test_util.inc",
Jisi Liud19604f2015-06-17 17:37:58 -0700566 "src/google/protobuf/test_util.cc",
Adam Cozzette5bed3682018-03-23 10:19:04 -0700567 "src/google/protobuf/test_util.inc",
Jisi Liud19604f2015-06-17 17:37:58 -0700568 "src/google/protobuf/testing/file.cc",
569 "src/google/protobuf/testing/googletest.cc",
570]
571
Jisi Liu7a0c4312015-06-18 16:45:27 -0700572cc_binary(
573 name = "test_plugin",
574 srcs = [
575 # AUTOGEN(test_plugin_srcs)
576 "src/google/protobuf/compiler/mock_code_generator.cc",
577 "src/google/protobuf/compiler/test_plugin.cc",
578 "src/google/protobuf/testing/file.cc",
579 ],
580 deps = [
581 ":protobuf",
582 ":protoc_lib",
Yannic2e51ad62020-03-03 00:15:22 +0100583 ] + GTEST,
Jisi Liu7a0c4312015-06-18 16:45:27 -0700584)
585
586cc_test(
Jisi Liu759245a2017-07-25 11:52:33 -0700587 name = "win32_test",
Hao Nguyenef1e8e72019-04-09 06:48:01 -0700588 srcs = ["src/google/protobuf/io/io_win32_unittest.cc"],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700589 tags = [
590 "manual",
591 "windows",
592 ],
Jisi Liu759245a2017-07-25 11:52:33 -0700593 deps = [
594 ":protobuf_lite",
Yannic2e51ad62020-03-03 00:15:22 +0100595 ] + GTEST_MAIN,
Jisi Liu759245a2017-07-25 11:52:33 -0700596)
597
598cc_test(
Jisi Liu7a0c4312015-06-18 16:45:27 -0700599 name = "protobuf_test",
Jisi Liu39362b32015-10-14 17:12:11 -0700600 srcs = COMMON_TEST_SRCS + [
Jisi Liu7a0c4312015-06-18 16:45:27 -0700601 # AUTOGEN(test_srcs)
602 "src/google/protobuf/any_test.cc",
603 "src/google/protobuf/arena_unittest.cc",
604 "src/google/protobuf/arenastring_unittest.cc",
Jisi Liu1c682e02017-10-18 14:31:23 -0700605 "src/google/protobuf/compiler/annotation_test_util.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700606 "src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc",
Jisi Liu11b66612017-07-19 12:10:43 -0700607 "src/google/protobuf/compiler/cpp/cpp_move_unittest.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700608 "src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc",
609 "src/google/protobuf/compiler/cpp/cpp_unittest.cc",
Adam Cozzette5bed3682018-03-23 10:19:04 -0700610 "src/google/protobuf/compiler/cpp/cpp_unittest.inc",
Jisi Liu1f4f3e22016-04-18 14:12:08 -0700611 "src/google/protobuf/compiler/cpp/metadata_test.cc",
Feng Xiao32d78302017-03-29 14:01:40 -0700612 "src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700613 "src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc",
614 "src/google/protobuf/compiler/importer_unittest.cc",
615 "src/google/protobuf/compiler/java/java_doc_comment_unittest.cc",
616 "src/google/protobuf/compiler/java/java_plugin_unittest.cc",
617 "src/google/protobuf/compiler/mock_code_generator.cc",
618 "src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc",
619 "src/google/protobuf/compiler/parser_unittest.cc",
620 "src/google/protobuf/compiler/python/python_plugin_unittest.cc",
621 "src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc",
622 "src/google/protobuf/descriptor_database_unittest.cc",
623 "src/google/protobuf/descriptor_unittest.cc",
624 "src/google/protobuf/drop_unknown_fields_test.cc",
625 "src/google/protobuf/dynamic_message_unittest.cc",
626 "src/google/protobuf/extension_set_unittest.cc",
627 "src/google/protobuf/generated_message_reflection_unittest.cc",
628 "src/google/protobuf/io/coded_stream_unittest.cc",
Hao Nguyenef1e8e72019-04-09 06:48:01 -0700629 "src/google/protobuf/io/io_win32_unittest.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700630 "src/google/protobuf/io/printer_unittest.cc",
631 "src/google/protobuf/io/tokenizer_unittest.cc",
632 "src/google/protobuf/io/zero_copy_stream_unittest.cc",
633 "src/google/protobuf/map_field_test.cc",
634 "src/google/protobuf/map_test.cc",
635 "src/google/protobuf/message_unittest.cc",
Adam Cozzette5bed3682018-03-23 10:19:04 -0700636 "src/google/protobuf/message_unittest.inc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700637 "src/google/protobuf/no_field_presence_test.cc",
638 "src/google/protobuf/preserve_unknown_enum_test.cc",
Chad Whipkeybaf52bd2016-04-15 09:23:50 -0700639 "src/google/protobuf/proto3_arena_lite_unittest.cc",
Jisi Liuf86d39c2016-04-28 14:43:22 -0700640 "src/google/protobuf/proto3_arena_unittest.cc",
Chad Whipkeybaf52bd2016-04-15 09:23:50 -0700641 "src/google/protobuf/proto3_lite_unittest.cc",
Feng Xiaobde4eaf2018-08-13 12:58:55 -0700642 "src/google/protobuf/proto3_lite_unittest.inc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700643 "src/google/protobuf/reflection_ops_unittest.cc",
644 "src/google/protobuf/repeated_field_reflection_unittest.cc",
645 "src/google/protobuf/repeated_field_unittest.cc",
646 "src/google/protobuf/stubs/bytestream_unittest.cc",
647 "src/google/protobuf/stubs/common_unittest.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700648 "src/google/protobuf/stubs/int128_unittest.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700649 "src/google/protobuf/stubs/status_test.cc",
650 "src/google/protobuf/stubs/statusor_test.cc",
651 "src/google/protobuf/stubs/stringpiece_unittest.cc",
652 "src/google/protobuf/stubs/stringprintf_unittest.cc",
653 "src/google/protobuf/stubs/structurally_valid_unittest.cc",
654 "src/google/protobuf/stubs/strutil_unittest.cc",
655 "src/google/protobuf/stubs/template_util_unittest.cc",
656 "src/google/protobuf/stubs/time_test.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700657 "src/google/protobuf/text_format_unittest.cc",
658 "src/google/protobuf/unknown_field_set_unittest.cc",
Byron Yicb3e84b2017-03-16 20:01:22 +0800659 "src/google/protobuf/util/delimited_message_util_test.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700660 "src/google/protobuf/util/field_comparator_test.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700661 "src/google/protobuf/util/field_mask_util_test.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700662 "src/google/protobuf/util/internal/default_value_objectwriter_test.cc",
663 "src/google/protobuf/util/internal/json_objectwriter_test.cc",
664 "src/google/protobuf/util/internal/json_stream_parser_test.cc",
665 "src/google/protobuf/util/internal/protostream_objectsource_test.cc",
666 "src/google/protobuf/util/internal/protostream_objectwriter_test.cc",
667 "src/google/protobuf/util/internal/type_info_test_helper.cc",
668 "src/google/protobuf/util/json_util_test.cc",
Feng Xiaoef6c72b2015-12-28 17:33:55 -0800669 "src/google/protobuf/util/message_differencer_unittest.cc",
Jisi Liub90f9f82015-08-25 17:06:33 -0700670 "src/google/protobuf/util/time_util_test.cc",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700671 "src/google/protobuf/util/type_resolver_util_test.cc",
672 "src/google/protobuf/well_known_types_unittest.cc",
673 "src/google/protobuf/wire_format_unittest.cc",
Yun Peng073487b2018-12-14 12:53:36 +0100674 ] + select({
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700675 "//conditions:default": [
Yannic Bonenberger49794892019-07-20 12:49:03 +0200676 # AUTOGEN(non_msvc_test_srcs)
Yun Peng073487b2018-12-14 12:53:36 +0100677 "src/google/protobuf/compiler/command_line_interface_unittest.cc",
678 ],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700679 ":msvc": [],
Yun Peng073487b2018-12-14 12:53:36 +0100680 }),
Jisi Liu7a0c4312015-06-18 16:45:27 -0700681 copts = COPTS,
682 data = [
683 ":test_plugin",
Jisi Liu598480d2015-10-21 11:19:16 -0700684 ] + glob([
685 "src/google/protobuf/**/*",
Feng Xiaoacde1652017-03-29 15:14:18 -0700686 # Files for csharp_bootstrap_unittest.cc.
687 "conformance/**/*",
688 "csharp/src/**/*",
Jisi Liu598480d2015-10-21 11:19:16 -0700689 ]),
Jisi Liu7a0c4312015-06-18 16:45:27 -0700690 includes = [
691 "src/",
692 ],
693 linkopts = LINK_OPTS,
694 deps = [
Jisi Liu993fb702015-10-19 17:19:49 -0700695 ":cc_test_protos",
Jisi Liu7a0c4312015-06-18 16:45:27 -0700696 ":protobuf",
697 ":protoc_lib",
Yannic2e51ad62020-03-03 00:15:22 +0100698 ] + PROTOBUF_DEPS + GTEST_MAIN,
Jisi Liu7a0c4312015-06-18 16:45:27 -0700699)
Jisi Liu993fb702015-10-19 17:19:49 -0700700
701################################################################################
702# Java support
703################################################################################
Yannicf0cb9cd2020-02-13 22:04:14 +0100704
Steven Parkesea188662016-02-25 07:53:19 -0800705internal_gen_well_known_protos_java(
Yannicf0cb9cd2020-02-13 22:04:14 +0100706 name = "gen_well_known_protos_java",
707 deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
708 visibility = [
709 "//java:__subpackages__",
710 ],
Jisi Liu993fb702015-10-19 17:19:49 -0700711)
712
Yannicf0cb9cd2020-02-13 22:04:14 +0100713alias(
Jisi Liu166e9bb2015-10-21 10:56:38 -0700714 name = "protobuf_java",
Yannicf0cb9cd2020-02-13 22:04:14 +0100715 actual = "//java/core",
Jisi Liu993fb702015-10-19 17:19:49 -0700716 visibility = ["//visibility:public"],
717)
718
Yannicf0cb9cd2020-02-13 22:04:14 +0100719alias(
Carmi Grushko5c25f412019-05-24 17:26:07 +0300720 name = "protobuf_javalite",
Yannicf0cb9cd2020-02-13 22:04:14 +0100721 actual = "//java/lite",
Jisi Liu993fb702015-10-19 17:19:49 -0700722 visibility = ["//visibility:public"],
723)
724
Yannicf0cb9cd2020-02-13 22:04:14 +0100725alias(
Steven Parkesa9244ca2016-03-10 17:50:25 -0800726 name = "protobuf_java_util",
Yannicf0cb9cd2020-02-13 22:04:14 +0100727 actual = "//java/util",
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800728 visibility = ["//visibility:public"],
Yannicf0cb9cd2020-02-13 22:04:14 +0100729)
730
731alias(
732 name = "java_toolchain",
733 actual = "//java/core:toolchain",
734 visibility = ["//visibility:public"],
735)
736
737alias(
738 name = "javalite_toolchain",
739 actual = "//java/lite:toolchain",
740 visibility = ["//visibility:public"],
Steven Parkesa9244ca2016-03-10 17:50:25 -0800741)
742
Jisi Liu993fb702015-10-19 17:19:49 -0700743################################################################################
744# Python support
745################################################################################
746
David Z. Chen985c9682016-02-11 18:11:10 -0800747py_library(
Jisi Liu993fb702015-10-19 17:19:49 -0700748 name = "python_srcs",
749 srcs = glob(
750 [
David L. Jones02955622020-09-23 15:20:38 -0700751 "python/google/protobuf/**/*.py",
Jisi Liu993fb702015-10-19 17:19:49 -0700752 ],
753 exclude = [
754 "python/google/protobuf/internal/*_test.py",
755 "python/google/protobuf/internal/test_util.py",
756 ],
757 ),
David Z. Chen985c9682016-02-11 18:11:10 -0800758 imports = ["python"],
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800759 srcs_version = "PY2AND3",
Jisi Liu993fb702015-10-19 17:19:49 -0700760)
761
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800762cc_binary(
Richard Shindf5841f2016-10-18 13:16:44 -0700763 name = "python/google/protobuf/internal/_api_implementation.so",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800764 srcs = ["python/google/protobuf/internal/api_implementation.cc"],
765 copts = COPTS + [
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800766 "-DPYTHON_PROTO2_CPP_IMPL_V2",
767 ],
Joshua Habermande371232020-10-21 10:04:14 -0700768 tags = [
769 # Exclude this target from wildcard expansion (//...) because it may
770 # not even be buildable. It will be built if it is needed according
771 # to :use_fast_cpp_protos.
772 # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes
773 "manual",
774 ],
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800775 linkshared = 1,
776 linkstatic = 1,
Manjunath Kudlura1949212015-12-08 08:24:37 -0800777 deps = select({
778 "//conditions:default": [],
David Z. Chen985c9682016-02-11 18:11:10 -0800779 ":use_fast_cpp_protos": ["//external:python_headers"],
Manjunath Kudlura1949212015-12-08 08:24:37 -0800780 }),
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800781)
782
783cc_binary(
Richard Shindf5841f2016-10-18 13:16:44 -0700784 name = "python/google/protobuf/pyext/_message.so",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800785 srcs = glob([
786 "python/google/protobuf/pyext/*.cc",
787 "python/google/protobuf/pyext/*.h",
788 ]),
789 copts = COPTS + [
790 "-DGOOGLE_PROTOBUF_HAS_ONEOF=1",
Manjunath Kudlur99a3e302016-02-16 15:17:10 -0800791 ] + select({
792 "//conditions:default": [],
793 ":allow_oversize_protos": ["-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1"],
794 }),
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800795 includes = [
796 "python/",
797 "src/",
798 ],
Joshua Habermande371232020-10-21 10:04:14 -0700799 tags = [
800 # Exclude this target from wildcard expansion (//...) because it may
801 # not even be buildable. It will be built if it is needed according
802 # to :use_fast_cpp_protos.
803 # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes
804 "manual",
805 ],
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800806 linkshared = 1,
807 linkstatic = 1,
Manjunath Kudlura1949212015-12-08 08:24:37 -0800808 deps = [
809 ":protobuf",
Thomas Colthurst7c651422018-05-29 18:26:11 -0400810 ":proto_api",
Manjunath Kudlura1949212015-12-08 08:24:37 -0800811 ] + select({
812 "//conditions:default": [],
David Z. Chen985c9682016-02-11 18:11:10 -0800813 ":use_fast_cpp_protos": ["//external:python_headers"],
Manjunath Kudlura1949212015-12-08 08:24:37 -0800814 }),
815)
816
817config_setting(
818 name = "use_fast_cpp_protos",
819 values = {
820 "define": "use_fast_cpp_protos=true",
821 },
Yannicf0cb9cd2020-02-13 22:04:14 +0100822 visibility = [
823 # Public, but Protobuf only visibility.
824 "//:__subpackages__",
825 ],
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800826)
827
Manjunath Kudlur99a3e302016-02-16 15:17:10 -0800828config_setting(
829 name = "allow_oversize_protos",
830 values = {
831 "define": "allow_oversize_protos=true",
832 },
Yannicf0cb9cd2020-02-13 22:04:14 +0100833 visibility = [
834 # Public, but Protobuf only visibility.
835 "//:__subpackages__",
836 ],
Manjunath Kudlur99a3e302016-02-16 15:17:10 -0800837)
838
David Z. Chen02cd45c2016-05-20 16:49:04 -0700839# Copy the builtin proto files from src/google/protobuf to
840# python/google/protobuf. This way, the generated Python sources will be in the
841# same directory as the Python runtime sources. This is necessary for the
842# modules to be imported correctly since they are all part of the same Python
843# package.
844internal_copied_filegroup(
845 name = "protos_python",
846 srcs = WELL_KNOWN_PROTOS,
David Z. Chen02cd45c2016-05-20 16:49:04 -0700847 dest = "python",
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800848 strip_prefix = "src",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700849)
850
851# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
852# which case we can simply add :protos_python in srcs.
Yannic Bonenbergera03d3322019-07-18 15:55:47 +0200853COPIED_WELL_KNOWN_PROTOS = ["python/" + s[4:] for s in WELL_KNOWN_PROTOS]
David Z. Chen02cd45c2016-05-20 16:49:04 -0700854
Jisi Liu993fb702015-10-19 17:19:49 -0700855py_proto_library(
Jisi Liu166e9bb2015-10-21 10:56:38 -0700856 name = "protobuf_python",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700857 srcs = COPIED_WELL_KNOWN_PROTOS,
858 include = "python",
Manjunath Kudlura1949212015-12-08 08:24:37 -0800859 data = select({
860 "//conditions:default": [],
861 ":use_fast_cpp_protos": [
Richard Shindf5841f2016-10-18 13:16:44 -0700862 ":python/google/protobuf/internal/_api_implementation.so",
863 ":python/google/protobuf/pyext/_message.so",
Manjunath Kudlura1949212015-12-08 08:24:37 -0800864 ],
865 }),
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800866 default_runtime = "",
Jisi Liu04658a32015-10-20 15:00:13 -0700867 protoc = ":protoc",
David Z. Chen985c9682016-02-11 18:11:10 -0800868 py_libs = [
869 ":python_srcs",
Adam Liddella74c43b2019-07-15 23:35:19 +0000870 "@six//:six",
David Z. Chen985c9682016-02-11 18:11:10 -0800871 ],
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800872 srcs_version = "PY2AND3",
Jisi Liu993fb702015-10-19 17:19:49 -0700873 visibility = ["//visibility:public"],
874)
875
David Z. Chen02cd45c2016-05-20 16:49:04 -0700876# Copy the test proto files from src/google/protobuf to
877# python/google/protobuf. This way, the generated Python sources will be in the
878# same directory as the Python runtime sources. This is necessary for the
879# modules to be imported correctly by the tests since they are all part of the
880# same Python package.
881internal_copied_filegroup(
882 name = "protos_python_test",
883 srcs = LITE_TEST_PROTOS + TEST_PROTOS,
David Z. Chen02cd45c2016-05-20 16:49:04 -0700884 dest = "python",
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800885 strip_prefix = "src",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700886)
887
888# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
889# which case we can simply add :protos_python_test in srcs.
890COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS]
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800891
David Z. Chen02cd45c2016-05-20 16:49:04 -0700892COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS]
893
Jisi Liu993fb702015-10-19 17:19:49 -0700894py_proto_library(
895 name = "python_common_test_protos",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700896 srcs = COPIED_LITE_TEST_PROTOS + COPIED_TEST_PROTOS,
897 include = "python",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800898 default_runtime = "",
Jisi Liu04658a32015-10-20 15:00:13 -0700899 protoc = ":protoc",
David Z. Chen5ebeefb2016-04-08 13:30:13 -0700900 srcs_version = "PY2AND3",
Jisi Liu166e9bb2015-10-21 10:56:38 -0700901 deps = [":protobuf_python"],
Jisi Liu993fb702015-10-19 17:19:49 -0700902)
903
904py_proto_library(
905 name = "python_specific_test_protos",
Jisi Liu68e13f42015-10-22 11:13:14 -0700906 srcs = glob([
907 "python/google/protobuf/internal/*.proto",
908 "python/google/protobuf/internal/import_test_package/*.proto",
909 ]),
Jisi Liu993fb702015-10-19 17:19:49 -0700910 include = "python",
Manjunath Kudlur3ff1dca2015-12-07 13:08:21 -0800911 default_runtime = ":protobuf_python",
Jisi Liu04658a32015-10-20 15:00:13 -0700912 protoc = ":protoc",
David Z. Chen5ebeefb2016-04-08 13:30:13 -0700913 srcs_version = "PY2AND3",
Jisi Liu993fb702015-10-19 17:19:49 -0700914 deps = [":python_common_test_protos"],
915)
916
917py_library(
918 name = "python_tests",
David Z. Chen985c9682016-02-11 18:11:10 -0800919 srcs = glob(
920 [
921 "python/google/protobuf/internal/*_test.py",
922 "python/google/protobuf/internal/test_util.py",
David Z. Chen02cd45c2016-05-20 16:49:04 -0700923 "python/google/protobuf/internal/import_test_package/__init__.py",
David Z. Chen985c9682016-02-11 18:11:10 -0800924 ],
925 ),
926 imports = ["python"],
Geoffrey Irving29799232015-12-03 13:11:19 -0800927 srcs_version = "PY2AND3",
Jisi Liu993fb702015-10-19 17:19:49 -0700928 deps = [
Jisi Liu166e9bb2015-10-21 10:56:38 -0700929 ":protobuf_python",
Jisi Liu598480d2015-10-21 11:19:16 -0700930 ":python_common_test_protos",
Jisi Liu993fb702015-10-19 17:19:49 -0700931 ":python_specific_test_protos",
932 ],
933)
934
935internal_protobuf_py_tests(
Jisi Liu8f540262015-10-20 16:21:41 -0700936 name = "python_tests_batch",
Jisi Liu68e13f42015-10-22 11:13:14 -0700937 data = glob([
938 "src/google/protobuf/**/*",
939 ]),
Jisi Liu993fb702015-10-19 17:19:49 -0700940 modules = [
941 "descriptor_database_test",
942 "descriptor_pool_test",
943 "descriptor_test",
944 "generator_test",
945 "json_format_test",
946 "message_factory_test",
Jisi Liu68e13f42015-10-22 11:13:14 -0700947 "message_test",
Jisi Liu993fb702015-10-19 17:19:49 -0700948 "proto_builder_test",
Jisi Liu68e13f42015-10-22 11:13:14 -0700949 "reflection_test",
Jisi Liu993fb702015-10-19 17:19:49 -0700950 "service_reflection_test",
951 "symbol_database_test",
952 "text_encoding_test",
Jisi Liu68e13f42015-10-22 11:13:14 -0700953 "text_format_test",
Jisi Liu993fb702015-10-19 17:19:49 -0700954 "unknown_fields_test",
955 "wire_format_test",
956 ],
957 deps = [":python_tests"],
958)
cgrushko45d92ae2016-12-02 19:40:50 -0500959
Thomas Colthurst7c651422018-05-29 18:26:11 -0400960cc_library(
961 name = "proto_api",
962 hdrs = ["python/google/protobuf/proto_api.h"],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700963 visibility = ["//visibility:public"],
Thomas Colthurst7c651422018-05-29 18:26:11 -0400964 deps = [
Thomas Colthurst7c651422018-05-29 18:26:11 -0400965 "//external:python_headers",
966 ],
967)
968
cgrushko45d92ae2016-12-02 19:40:50 -0500969proto_lang_toolchain(
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800970 name = "cc_toolchain",
Yanniccdc7fe82020-06-26 19:07:17 +0200971 blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
Manjunath Kudlur2d430f82017-02-23 08:17:24 -0800972 command_line = "--cpp_out=$(OUT)",
973 runtime = ":protobuf",
974 visibility = ["//visibility:public"],
cgrushko45d92ae2016-12-02 19:40:50 -0500975)
cgrushkoe4baf3f2017-01-12 12:51:04 -0500976
Thomas Van Lenten18aa2962018-11-01 09:37:14 -0400977alias(
978 name = "objectivec",
Yannic Bonenberger8b93b8e2020-07-08 17:21:38 +0200979 actual = "//objectivec",
Thomas Van Lenten18aa2962018-11-01 09:37:14 -0400980 visibility = ["//visibility:public"],
981)
makdharma286f0592017-05-01 09:49:26 -0700982
Yannic Bonenberger8b93b8e2020-07-08 17:21:38 +0200983alias(
Thomas Van Lenten18aa2962018-11-01 09:37:14 -0400984 name = "protobuf_objc",
Yannic Bonenberger8b93b8e2020-07-08 17:21:38 +0200985 actual = "//objectivec",
makdharma286f0592017-05-01 09:49:26 -0700986 visibility = ["//visibility:public"],
987)
Fahrzin Hemmati0d68b292018-03-26 19:08:26 -0700988
989################################################################################
990# Test generated proto support
991################################################################################
992
993genrule(
994 name = "generated_protos",
995 srcs = ["src/google/protobuf/unittest_import.proto"],
996 outs = ["unittest_gen.proto"],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -0700997 cmd = "cat $(SRCS) | sed 's|google/|src/google/|' > $(OUTS)",
Fahrzin Hemmati0d68b292018-03-26 19:08:26 -0700998)
999
1000proto_library(
1001 name = "generated_protos_proto",
Fahrzin Hemmati55962db2018-05-07 17:36:34 -07001002 srcs = [
Fahrzin Hemmati55962db2018-05-07 17:36:34 -07001003 "src/google/protobuf/unittest_import_public.proto",
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -07001004 "unittest_gen.proto",
Fahrzin Hemmati55962db2018-05-07 17:36:34 -07001005 ],
Fahrzin Hemmati0d68b292018-03-26 19:08:26 -07001006)
1007
Fahrzin Hemmati0d68b292018-03-26 19:08:26 -07001008py_proto_library(
1009 name = "generated_protos_py",
1010 srcs = [
Fahrzin Hemmati0d68b292018-03-26 19:08:26 -07001011 "src/google/protobuf/unittest_import_public.proto",
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -07001012 "unittest_gen.proto",
Fahrzin Hemmati0d68b292018-03-26 19:08:26 -07001013 ],
1014 default_runtime = "",
1015 protoc = ":protoc",
1016)
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001017
1018################################################################################
1019# Conformance tests
1020################################################################################
1021
1022proto_library(
1023 name = "test_messages_proto2_proto",
Joshua Haberman2996da42019-05-13 07:45:30 -07001024 srcs = ["src/google/protobuf/test_messages_proto2.proto"],
Josh Haberman25feb592018-11-03 14:43:20 -07001025 visibility = ["//visibility:public"],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001026)
1027
1028proto_library(
1029 name = "test_messages_proto3_proto",
Joshua Haberman2996da42019-05-13 07:45:30 -07001030 srcs = ["src/google/protobuf/test_messages_proto3.proto"],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -07001031 visibility = ["//visibility:public"],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001032 deps = [
1033 ":any_proto",
1034 ":duration_proto",
1035 ":field_mask_proto",
1036 ":struct_proto",
1037 ":timestamp_proto",
1038 ":wrappers_proto",
1039 ],
1040)
1041
1042cc_proto_library(
1043 name = "test_messages_proto2_proto_cc",
Joshua Haberman2996da42019-05-13 07:45:30 -07001044 srcs = ["src/google/protobuf/test_messages_proto2.proto"],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001045)
1046
1047cc_proto_library(
1048 name = "test_messages_proto3_proto_cc",
Joshua Haberman2996da42019-05-13 07:45:30 -07001049 srcs = ["src/google/protobuf/test_messages_proto3.proto"],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001050 deps = [
1051 ":cc_wkt_protos",
1052 ],
1053)
1054
1055proto_library(
1056 name = "conformance_proto",
Joshua Haberman2996da42019-05-13 07:45:30 -07001057 srcs = ["conformance/conformance.proto"],
Josh Haberman25feb592018-11-03 14:43:20 -07001058 visibility = ["//visibility:public"],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001059)
1060
1061cc_proto_library(
1062 name = "conformance_proto_cc",
1063 srcs = ["conformance/conformance.proto"],
1064)
1065
1066cc_library(
1067 name = "jsoncpp",
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001068 srcs = ["conformance/third_party/jsoncpp/jsoncpp.cpp"],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -07001069 hdrs = ["conformance/third_party/jsoncpp/json.h"],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001070 includes = ["conformance"],
1071)
1072
1073cc_library(
1074 name = "conformance_test",
1075 srcs = [
1076 "conformance/conformance_test.cc",
Joshua Haberman2996da42019-05-13 07:45:30 -07001077 "conformance/conformance_test_runner.cc",
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001078 ],
1079 hdrs = [
1080 "conformance/conformance_test.h",
1081 ],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -07001082 includes = [
1083 "conformance",
1084 "src",
1085 ],
Joshua Haberman2996da42019-05-13 07:45:30 -07001086 deps = [":conformance_proto_cc"],
Joshua Haberman2996da42019-05-13 07:45:30 -07001087)
1088
1089cc_library(
1090 name = "binary_json_conformance_suite",
1091 srcs = ["conformance/binary_json_conformance_suite.cc"],
1092 hdrs = ["conformance/binary_json_conformance_suite.h"],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001093 deps = [
Joshua Haberman2996da42019-05-13 07:45:30 -07001094 ":conformance_test",
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001095 ":jsoncpp",
1096 ":test_messages_proto2_proto_cc",
1097 ":test_messages_proto3_proto_cc",
1098 ],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001099)
1100
Joshua Haberman2996da42019-05-13 07:45:30 -07001101cc_library(
1102 name = "text_format_conformance_suite",
1103 srcs = ["conformance/text_format_conformance_suite.cc"],
1104 hdrs = ["conformance/text_format_conformance_suite.h"],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001105 deps = [
1106 ":conformance_test",
Joshua Haberman2996da42019-05-13 07:45:30 -07001107 ":test_messages_proto2_proto_cc",
1108 ":test_messages_proto3_proto_cc",
1109 ],
1110)
1111
Joshua Habermanc659a4a2019-05-14 14:01:16 -07001112cc_binary(
Joshua Haberman2996da42019-05-13 07:45:30 -07001113 name = "conformance_test_runner",
1114 srcs = ["conformance/conformance_test_main.cc"],
Liam Miller-Cushon2b857d02019-07-01 12:21:04 -07001115 visibility = ["//visibility:public"],
Joshua Haberman2996da42019-05-13 07:45:30 -07001116 deps = [
1117 ":binary_json_conformance_suite",
1118 ":conformance_test",
1119 ":text_format_conformance_suite",
Josh Haberman25feb592018-11-03 14:43:20 -07001120 ],
Josh Haberman6dec8cf2018-11-03 12:59:45 -07001121)
Yannic Bonenberger49794892019-07-20 12:49:03 +02001122
1123sh_test(
1124 name = "build_files_updated_unittest",
1125 srcs = [
1126 "build_files_updated_unittest.sh",
1127 ],
1128 data = [
1129 "BUILD",
1130 "cmake/extract_includes.bat.in",
1131 "cmake/libprotobuf.cmake",
1132 "cmake/libprotobuf-lite.cmake",
1133 "cmake/libprotoc.cmake",
1134 "cmake/tests.cmake",
1135 "src/Makefile.am",
1136 "update_file_lists.sh",
1137 ],
1138)