Laszlo Csomor | 5517168 | 2017-12-01 12:05:32 +0100 | [diff] [blame] | 1 | # Bazel (https://bazel.build/) BUILD file for Protobuf. |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 2 | |
Yannic | 2e51ad6 | 2020-03-03 00:15:22 +0100 | [diff] [blame] | 3 | load("@bazel_skylib//rules:common_settings.bzl", "string_flag") |
Yannic | 948740b | 2020-01-15 19:27:35 +0100 | [diff] [blame] | 4 | load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library") |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 5 | load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") |
Yannic Bonenberger | d2d6ff5 | 2019-08-06 21:12:06 +0200 | [diff] [blame] | 6 | load("@rules_python//python:defs.bzl", "py_library") |
Yannic | 948740b | 2020-01-15 19:27:35 +0100 | [diff] [blame] | 7 | load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test") |
Yannic Bonenberger | 6e89919 | 2019-07-23 16:28:57 +0200 | [diff] [blame] | 8 | |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 9 | licenses(["notice"]) |
| 10 | |
Piotr Sikora | faea19c | 2016-08-04 15:32:14 -0700 | [diff] [blame] | 11 | exports_files(["LICENSE"]) |
| 12 | |
Jorge Canizales | d5d7bb3 | 2015-06-28 15:23:02 -0700 | [diff] [blame] | 13 | ################################################################################ |
Yannic | 2e51ad6 | 2020-03-03 00:15:22 +0100 | [diff] [blame] | 14 | # build configuration |
| 15 | ################################################################################ |
| 16 | |
Joshua Haberman | de37123 | 2020-10-21 10:04:14 -0700 | [diff] [blame] | 17 | # TODO(yannic): Remove in 3.14.0. |
Yannic | 2e51ad6 | 2020-03-03 00:15:22 +0100 | [diff] [blame] | 18 | string_flag( |
| 19 | name = "incompatible_use_com_google_googletest", |
Joshua Haberman | de37123 | 2020-10-21 10:04:14 -0700 | [diff] [blame] | 20 | build_setting_default = "true", |
Yannic | 2e51ad6 | 2020-03-03 00:15:22 +0100 | [diff] [blame] | 21 | values = ["true", "false"] |
| 22 | ) |
| 23 | |
| 24 | config_setting( |
| 25 | name = "use_com_google_googletest", |
| 26 | flag_values = { |
| 27 | "//:incompatible_use_com_google_googletest": "true" |
| 28 | }, |
| 29 | ) |
| 30 | |
| 31 | GTEST = select({ |
| 32 | "//:use_com_google_googletest": [ |
| 33 | "@com_google_googletest//:gtest", |
| 34 | ], |
| 35 | "//conditions:default": [ |
| 36 | "//external:gtest", |
| 37 | ], |
| 38 | }) |
| 39 | |
| 40 | GTEST_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 Schroeder | 802d543 | 2018-12-11 11:58:26 -0800 | [diff] [blame] | 50 | # ZLIB configuration |
| 51 | ################################################################################ |
| 52 | |
Nic McDonald | f313b9c | 2019-04-12 15:41:08 -0700 | [diff] [blame] | 53 | ZLIB_DEPS = ["@zlib//:zlib"] |
Cody Schroeder | 802d543 | 2018-12-11 11:58:26 -0800 | [diff] [blame] | 54 | |
| 55 | ################################################################################ |
Jorge Canizales | d5d7bb3 | 2015-06-28 15:23:02 -0700 | [diff] [blame] | 56 | # Protobuf Runtime Library |
| 57 | ################################################################################ |
| 58 | |
Pascal Muetschard | a6957f2 | 2018-03-22 13:14:10 -0700 | [diff] [blame] | 59 | MSVC_COPTS = [ |
Yun Peng | 0b059a3 | 2017-05-31 14:01:23 +0200 | [diff] [blame] | 60 | "/DHAVE_PTHREAD", |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 61 | "/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 Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 76 | ] |
| 77 | |
Yun Peng | 0b059a3 | 2017-05-31 14:01:23 +0200 | [diff] [blame] | 78 | COPTS = select({ |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 79 | ":msvc": MSVC_COPTS, |
Yun Peng | 0b059a3 | 2017-05-31 14:01:23 +0200 | [diff] [blame] | 80 | "//conditions:default": [ |
| 81 | "-DHAVE_PTHREAD", |
Cody Schroeder | 802d543 | 2018-12-11 11:58:26 -0800 | [diff] [blame] | 82 | "-DHAVE_ZLIB", |
Yun Peng | 0b059a3 | 2017-05-31 14:01:23 +0200 | [diff] [blame] | 83 | "-Woverloaded-virtual", |
| 84 | "-Wno-sign-compare", |
| 85 | "-Wno-unused-function", |
Justine Tunney | ac5371d | 2017-11-17 18:27:39 -0800 | [diff] [blame] | 86 | # Prevents ISO C++ const string assignment warnings for pyext sources. |
depristo | 2506cf5 | 2018-06-28 22:54:43 +0000 | [diff] [blame] | 87 | "-Wno-write-strings", |
Adam Cozzette | f4ceaec | 2019-09-04 11:20:45 -0700 | [diff] [blame] | 88 | "-Wno-deprecated-declarations", |
Yun Peng | 0b059a3 | 2017-05-31 14:01:23 +0200 | [diff] [blame] | 89 | ], |
| 90 | }) |
| 91 | |
scentini | b30ddee | 2018-08-28 14:07:55 +0200 | [diff] [blame] | 92 | load(":compiler_config_setting.bzl", "create_compiler_config_setting") |
| 93 | |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 94 | create_compiler_config_setting( |
Pascal Muetschard | a6957f2 | 2018-03-22 13:14:10 -0700 | [diff] [blame] | 95 | name = "msvc", |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 96 | value = "msvc-cl", |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 97 | visibility = [ |
| 98 | # Public, but Protobuf only visibility. |
| 99 | "//:__subpackages__", |
| 100 | ], |
Yun Peng | 0b059a3 | 2017-05-31 14:01:23 +0200 | [diff] [blame] | 101 | ) |
| 102 | |
Andrew Harp | b56b461 | 2016-04-04 15:13:30 -0400 | [diff] [blame] | 103 | config_setting( |
| 104 | name = "android", |
| 105 | values = { |
| 106 | "crosstool_top": "//external:android/crosstool", |
| 107 | }, |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 108 | visibility = [ |
| 109 | # Public, but Protobuf only visibility. |
| 110 | "//:__subpackages__", |
| 111 | ], |
Andrew Harp | b56b461 | 2016-04-04 15:13:30 -0400 | [diff] [blame] | 112 | ) |
| 113 | |
yejianwu | df4ec8a | 2019-04-02 20:08:37 +0800 | [diff] [blame] | 114 | config_setting( |
| 115 | name = "android-libcpp", |
| 116 | values = { |
| 117 | "crosstool_top": "@androidndk//:toolchain-libcpp", |
| 118 | }, |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 119 | visibility = [ |
| 120 | # Public, but Protobuf only visibility. |
| 121 | "//:__subpackages__", |
| 122 | ], |
yejianwu | df4ec8a | 2019-04-02 20:08:37 +0800 | [diff] [blame] | 123 | ) |
| 124 | |
| 125 | config_setting( |
| 126 | name = "android-gnu-libstdcpp", |
| 127 | values = { |
| 128 | "crosstool_top": "@androidndk//:toolchain-gnu-libstdcpp", |
| 129 | }, |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 130 | visibility = [ |
| 131 | # Public, but Protobuf only visibility. |
| 132 | "//:__subpackages__", |
| 133 | ], |
yejianwu | df4ec8a | 2019-04-02 20:08:37 +0800 | [diff] [blame] | 134 | ) |
| 135 | |
Pascal Muetschard | a6957f2 | 2018-03-22 13:14:10 -0700 | [diff] [blame] | 136 | # Android and MSVC builds do not need to link in a separate pthread library. |
Andrew Harp | b56b461 | 2016-04-04 15:13:30 -0400 | [diff] [blame] | 137 | LINK_OPTS = select({ |
Andrew Harp | 3b4e7dc | 2016-04-04 16:13:31 -0400 | [diff] [blame] | 138 | ":android": [], |
yejianwu | df4ec8a | 2019-04-02 20:08:37 +0800 | [diff] [blame] | 139 | ":android-libcpp": [], |
| 140 | ":android-gnu-libstdcpp": [], |
Jan Tattermusch | ccc56a3 | 2018-05-24 09:51:53 -0700 | [diff] [blame] | 141 | ":msvc": [ |
Loo Rong Jie | 0456e26 | 2018-06-06 10:03:25 +0800 | [diff] [blame] | 142 | # Suppress linker warnings about files with no symbols defined. |
| 143 | "-ignore:4221", |
Laszlo Csomor | 5517168 | 2017-12-01 12:05:32 +0100 | [diff] [blame] | 144 | ], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 145 | "//conditions:default": [ |
| 146 | "-lpthread", |
| 147 | "-lm", |
| 148 | ], |
Andrew Harp | b56b461 | 2016-04-04 15:13:30 -0400 | [diff] [blame] | 149 | }) |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 150 | |
Jisi Liu | 04658a3 | 2015-10-20 15:00:13 -0700 | [diff] [blame] | 151 | load( |
cgrushko | 65a4d20 | 2017-02-08 15:23:57 -0500 | [diff] [blame] | 152 | ":protobuf.bzl", |
Yannic Bonenberger | 723a85f | 2020-02-15 13:26:56 +0100 | [diff] [blame] | 153 | "adapt_proto_library", |
Jisi Liu | 04658a3 | 2015-10-20 15:00:13 -0700 | [diff] [blame] | 154 | "cc_proto_library", |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 155 | "internal_copied_filegroup", |
Steven Parkes | ea18866 | 2016-02-25 07:53:19 -0800 | [diff] [blame] | 156 | "internal_gen_well_known_protos_java", |
Jisi Liu | 04658a3 | 2015-10-20 15:00:13 -0700 | [diff] [blame] | 157 | "internal_protobuf_py_tests", |
Yannic Bonenberger | 4979489 | 2019-07-20 12:49:03 +0200 | [diff] [blame] | 158 | "py_proto_library", |
Jisi Liu | 04658a3 | 2015-10-20 15:00:13 -0700 | [diff] [blame] | 159 | ) |
Jisi Liu | 39362b3 | 2015-10-14 17:12:11 -0700 | [diff] [blame] | 160 | |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 161 | cc_library( |
| 162 | name = "protobuf_lite", |
| 163 | srcs = [ |
| 164 | # AUTOGEN(protobuf_lite_srcs) |
Phillipp Schoppmann | 8e5b2f1 | 2019-03-14 10:35:05 +0000 | [diff] [blame] | 165 | "src/google/protobuf/any_lite.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 166 | "src/google/protobuf/arena.cc", |
Joshua Haberman | a633ad4 | 2020-09-28 12:19:39 -0700 | [diff] [blame] | 167 | "src/google/protobuf/arenastring.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 168 | "src/google/protobuf/extension_set.cc", |
Hao Nguyen | 4cebf97 | 2019-05-03 15:08:01 -0700 | [diff] [blame] | 169 | "src/google/protobuf/generated_enum_util.cc", |
Jisi Liu | 12c186f | 2017-07-25 14:38:00 -0700 | [diff] [blame] | 170 | "src/google/protobuf/generated_message_table_driven_lite.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 171 | "src/google/protobuf/generated_message_util.cc", |
Adam Cozzette | 609d752 | 2017-12-07 14:16:50 -0800 | [diff] [blame] | 172 | "src/google/protobuf/implicit_weak_message.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 173 | "src/google/protobuf/io/coded_stream.cc", |
Hao Nguyen | ef1e8e7 | 2019-04-09 06:48:01 -0700 | [diff] [blame] | 174 | "src/google/protobuf/io/io_win32.cc", |
John W. Bruce | 21e4b1c | 2019-06-05 18:28:16 -0700 | [diff] [blame] | 175 | "src/google/protobuf/io/strtod.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 176 | "src/google/protobuf/io/zero_copy_stream.cc", |
Hao Nguyen | 4cebf97 | 2019-05-03 15:08:01 -0700 | [diff] [blame] | 177 | "src/google/protobuf/io/zero_copy_stream_impl.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 178 | "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", |
Joshua Haberman | b3cdd40 | 2020-08-17 17:12:44 -0700 | [diff] [blame] | 179 | "src/google/protobuf/map.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 180 | "src/google/protobuf/message_lite.cc", |
Phillipp Schoppmann | 8e5b2f1 | 2019-03-14 10:35:05 +0000 | [diff] [blame] | 181 | "src/google/protobuf/parse_context.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 182 | "src/google/protobuf/repeated_field.cc", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 183 | "src/google/protobuf/stubs/bytestream.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 184 | "src/google/protobuf/stubs/common.cc", |
Jisi Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 185 | "src/google/protobuf/stubs/int128.cc", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 186 | "src/google/protobuf/stubs/status.cc", |
| 187 | "src/google/protobuf/stubs/statusor.cc", |
| 188 | "src/google/protobuf/stubs/stringpiece.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 189 | "src/google/protobuf/stubs/stringprintf.cc", |
Jisi Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 190 | "src/google/protobuf/stubs/structurally_valid.cc", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 191 | "src/google/protobuf/stubs/strutil.cc", |
| 192 | "src/google/protobuf/stubs/time.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 193 | "src/google/protobuf/wire_format_lite.cc", |
| 194 | ], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 195 | hdrs = glob([ |
| 196 | "src/google/protobuf/**/*.h", |
| 197 | "src/google/protobuf/**/*.inc", |
| 198 | ]), |
Param Reddy | 16792c6 | 2017-10-15 13:06:58 -0700 | [diff] [blame] | 199 | copts = COPTS, |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 200 | includes = ["src/"], |
| 201 | linkopts = LINK_OPTS, |
| 202 | visibility = ["//visibility:public"], |
| 203 | ) |
| 204 | |
Cody Schroeder | 802d543 | 2018-12-11 11:58:26 -0800 | [diff] [blame] | 205 | PROTOBUF_DEPS = select({ |
| 206 | ":msvc": [], |
| 207 | "//conditions:default": ZLIB_DEPS, |
| 208 | }) |
| 209 | |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 210 | cc_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 Liu | 759245a | 2017-07-25 11:52:33 -0700 | [diff] [blame] | 228 | "src/google/protobuf/generated_message_table_driven.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 229 | "src/google/protobuf/io/gzip_stream.cc", |
| 230 | "src/google/protobuf/io/printer.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 231 | "src/google/protobuf/io/tokenizer.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 232 | "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 Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 238 | "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 Yi | 312e2db | 2017-03-21 03:52:37 +0800 | [diff] [blame] | 243 | "src/google/protobuf/util/delimited_message_util.cc", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 244 | "src/google/protobuf/util/field_comparator.cc", |
Jisi Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 245 | "src/google/protobuf/util/field_mask_util.cc", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 246 | "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 Xiao | ef6c72b | 2015-12-28 17:33:55 -0800 | [diff] [blame] | 254 | "src/google/protobuf/util/internal/proto_writer.cc", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 255 | "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 Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 262 | "src/google/protobuf/util/time_util.cc", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 263 | "src/google/protobuf/util/type_resolver_util.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 264 | "src/google/protobuf/wire_format.cc", |
| 265 | "src/google/protobuf/wrappers.pb.cc", |
| 266 | ], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 267 | hdrs = glob([ |
| 268 | "src/**/*.h", |
| 269 | "src/**/*.inc", |
| 270 | ]), |
Param Reddy | 16792c6 | 2017-10-15 13:06:58 -0700 | [diff] [blame] | 271 | copts = COPTS, |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 272 | includes = ["src/"], |
| 273 | linkopts = LINK_OPTS, |
| 274 | visibility = ["//visibility:public"], |
Cody Schroeder | 802d543 | 2018-12-11 11:58:26 -0800 | [diff] [blame] | 275 | deps = [":protobuf_lite"] + PROTOBUF_DEPS, |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 276 | ) |
| 277 | |
Manjunath Kudlur | 6837b2d | 2017-03-02 18:02:05 -0800 | [diff] [blame] | 278 | # 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 Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 282 | cc_library( |
| 283 | name = "protobuf_headers", |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 284 | hdrs = glob([ |
| 285 | "src/**/*.h", |
| 286 | "src/**/*.inc", |
| 287 | ]), |
Manjunath Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 288 | includes = ["src/"], |
| 289 | visibility = ["//visibility:public"], |
| 290 | ) |
| 291 | |
Jakob Buchgraber | 699c0eb | 2017-09-05 17:15:10 +0200 | [diff] [blame] | 292 | # Map of all well known protos. |
| 293 | # name => (include path, imports) |
| 294 | WELL_KNOWN_PROTO_MAP = { |
Yannic Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 295 | "any": ("src/google/protobuf/any.proto", []), |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 296 | "api": ( |
Yannic Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 297 | "src/google/protobuf/api.proto", |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 298 | [ |
| 299 | "source_context", |
| 300 | "type", |
| 301 | ], |
| 302 | ), |
| 303 | "compiler_plugin": ( |
Yannic Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 304 | "src/google/protobuf/compiler/plugin.proto", |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 305 | ["descriptor"], |
| 306 | ), |
Yannic Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 307 | "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-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 314 | "type": ( |
Yannic Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 315 | "src/google/protobuf/type.proto", |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 316 | [ |
| 317 | "any", |
| 318 | "source_context", |
| 319 | ], |
| 320 | ), |
Yannic Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 321 | "wrappers": ("src/google/protobuf/wrappers.proto", []), |
Jakob Buchgraber | 699c0eb | 2017-09-05 17:15:10 +0200 | [diff] [blame] | 322 | } |
| 323 | |
Yannic Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 324 | WELL_KNOWN_PROTOS = [value[0] for value in WELL_KNOWN_PROTO_MAP.values()] |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 325 | |
Steven Parkes | d5a5732 | 2016-03-22 17:56:07 -0700 | [diff] [blame] | 326 | filegroup( |
| 327 | name = "well_known_protos", |
| 328 | srcs = WELL_KNOWN_PROTOS, |
| 329 | visibility = ["//visibility:public"], |
| 330 | ) |
| 331 | |
Yannic Bonenberger | 723a85f | 2020-02-15 13:26:56 +0100 | [diff] [blame] | 332 | adapt_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 | |
| 338 | cc_library( |
Jisi Liu | 39362b3 | 2015-10-14 17:12:11 -0700 | [diff] [blame] | 339 | name = "cc_wkt_protos", |
Yannic Bonenberger | 723a85f | 2020-02-15 13:26:56 +0100 | [diff] [blame] | 340 | deprecation = "Only for backward compatibility. Do not use.", |
Jisi Liu | 6a40bf8 | 2015-11-17 12:36:21 -0800 | [diff] [blame] | 341 | visibility = ["//visibility:public"], |
Jisi Liu | 39362b3 | 2015-10-14 17:12:11 -0700 | [diff] [blame] | 342 | ) |
| 343 | |
Jorge Canizales | d5d7bb3 | 2015-06-28 15:23:02 -0700 | [diff] [blame] | 344 | ################################################################################ |
Jakob Buchgraber | 699c0eb | 2017-09-05 17:15:10 +0200 | [diff] [blame] | 345 | # 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 Buchgraber | 699c0eb | 2017-09-05 17:15:10 +0200 | [diff] [blame] | 356 | [proto_library( |
| 357 | name = proto[0] + "_proto", |
| 358 | srcs = [proto[1][0]], |
Yannic Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 359 | strip_import_prefix = "src", |
Jakob Buchgraber | 699c0eb | 2017-09-05 17:15:10 +0200 | [diff] [blame] | 360 | visibility = ["//visibility:public"], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 361 | deps = [dep + "_proto" for dep in proto[1][1]], |
| 362 | ) for proto in WELL_KNOWN_PROTO_MAP.items()] |
Jakob Buchgraber | 699c0eb | 2017-09-05 17:15:10 +0200 | [diff] [blame] | 363 | |
Yannic | 948740b | 2020-01-15 19:27:35 +0100 | [diff] [blame] | 364 | [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 | |
| 370 | cc_proto_blacklist_test( |
| 371 | name = "cc_proto_blacklist_test", |
Joshua Haberman | de37123 | 2020-10-21 10:04:14 -0700 | [diff] [blame] | 372 | 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 | ], |
Yannic | 948740b | 2020-01-15 19:27:35 +0100 | [diff] [blame] | 381 | ) |
| 382 | |
Jakob Buchgraber | 699c0eb | 2017-09-05 17:15:10 +0200 | [diff] [blame] | 383 | ################################################################################ |
Jorge Canizales | d5d7bb3 | 2015-06-28 15:23:02 -0700 | [diff] [blame] | 384 | # Protocol Buffers Compiler |
| 385 | ################################################################################ |
| 386 | |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 387 | cc_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 Cozzette | 13fd045 | 2017-09-12 10:32:01 -0700 | [diff] [blame] | 403 | "src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 404 | "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 Zhao | 5cdd936 | 2015-10-05 14:37:21 -0700 | [diff] [blame] | 407 | "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 408 | "src/google/protobuf/compiler/csharp/csharp_enum.cc", |
| 409 | "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 410 | "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 Skeet | b2ac868 | 2015-07-15 13:17:42 +0100 | [diff] [blame] | 413 | "src/google/protobuf/compiler/csharp/csharp_map_field.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 414 | "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 Skeet | a6361a1 | 2015-11-19 13:05:17 +0000 | [diff] [blame] | 417 | "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 418 | "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 Skeet | b2ac868 | 2015-07-15 13:17:42 +0100 | [diff] [blame] | 422 | "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 423 | "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 Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 428 | "src/google/protobuf/compiler/java/java_enum_lite.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 429 | "src/google/protobuf/compiler/java/java_extension.cc", |
Jisi Liu | 1f4f3e2 | 2016-04-18 14:12:08 -0700 | [diff] [blame] | 430 | "src/google/protobuf/compiler/java/java_extension_lite.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 431 | "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 Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 436 | "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 Xiao | ef6c72b | 2015-12-28 17:33:55 -0800 | [diff] [blame] | 451 | "src/google/protobuf/compiler/js/js_generator.cc", |
Jisi Liu | f92b455 | 2016-12-05 10:16:47 -0800 | [diff] [blame] | 452 | "src/google/protobuf/compiler/js/well_known_types_embed.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 453 | "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 Liu | d947308 | 2016-09-22 15:14:58 -0700 | [diff] [blame] | 465 | "src/google/protobuf/compiler/php/php_generator.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 466 | "src/google/protobuf/compiler/plugin.cc", |
Feng Xiao | fd595fc | 2018-03-01 16:36:05 -0800 | [diff] [blame] | 467 | "src/google/protobuf/compiler/plugin.pb.cc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 468 | "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 Csomor | 414a625 | 2018-08-14 16:01:24 +0200 | [diff] [blame] | 475 | linkopts = LINK_OPTS, |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 476 | visibility = ["//visibility:public"], |
| 477 | deps = [":protobuf"], |
| 478 | ) |
| 479 | |
| 480 | cc_binary( |
| 481 | name = "protoc", |
| 482 | srcs = ["src/google/protobuf/compiler/main.cc"], |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 483 | linkopts = LINK_OPTS, |
| 484 | visibility = ["//visibility:public"], |
| 485 | deps = [":protoc_lib"], |
| 486 | ) |
| 487 | |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 488 | ################################################################################ |
| 489 | # Tests |
| 490 | ################################################################################ |
| 491 | |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 492 | RELATIVE_LITE_TEST_PROTOS = [ |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 493 | # 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 Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 500 | LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS] |
| 501 | |
| 502 | RELATIVE_TEST_PROTOS = [ |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 503 | # 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 Xiao | 32d7830 | 2017-03-29 14:01:40 -0700 | [diff] [blame] | 518 | "google/protobuf/unittest_lazy_dependencies.proto", |
| 519 | "google/protobuf/unittest_lazy_dependencies_custom_option.proto", |
| 520 | "google/protobuf/unittest_lazy_dependencies_enum.proto", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 521 | "google/protobuf/unittest_lite_imports_nonlite.proto", |
| 522 | "google/protobuf/unittest_mset.proto", |
Jisi Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 523 | "google/protobuf/unittest_mset_wire_format.proto", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 524 | "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 Xiao | bde4eaf | 2018-08-13 12:58:55 -0700 | [diff] [blame] | 529 | "google/protobuf/unittest_proto3.proto", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 530 | "google/protobuf/unittest_proto3_arena.proto", |
Chad Whipkey | baf52bd | 2016-04-15 09:23:50 -0700 | [diff] [blame] | 531 | "google/protobuf/unittest_proto3_arena_lite.proto", |
| 532 | "google/protobuf/unittest_proto3_lite.proto", |
Joshua Haberman | 2435589 | 2020-03-31 17:31:32 -0700 | [diff] [blame] | 533 | "google/protobuf/unittest_proto3_optional.proto", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 534 | "google/protobuf/unittest_well_known_types.proto", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 535 | "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 Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 541 | "google/protobuf/util/internal/testdata/oneofs.proto", |
Jisi Liu | 9d4657a | 2016-09-22 15:11:17 -0700 | [diff] [blame] | 542 | "google/protobuf/util/internal/testdata/proto3.proto", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 543 | "google/protobuf/util/internal/testdata/struct.proto", |
| 544 | "google/protobuf/util/internal/testdata/timestamp_duration.proto", |
Jisi Liu | 9d4657a | 2016-09-22 15:11:17 -0700 | [diff] [blame] | 545 | "google/protobuf/util/internal/testdata/wrappers.proto", |
Feng Xiao | bde4eaf | 2018-08-13 12:58:55 -0700 | [diff] [blame] | 546 | "google/protobuf/util/json_format.proto", |
Jisi Liu | af3eafd | 2015-06-18 13:38:36 -0700 | [diff] [blame] | 547 | "google/protobuf/util/json_format_proto3.proto", |
Feng Xiao | ef6c72b | 2015-12-28 17:33:55 -0800 | [diff] [blame] | 548 | "google/protobuf/util/message_differencer_unittest.proto", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 549 | ] |
| 550 | |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 551 | TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS] |
| 552 | |
Jisi Liu | 39362b3 | 2015-10-14 17:12:11 -0700 | [diff] [blame] | 553 | cc_proto_library( |
| 554 | name = "cc_test_protos", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 555 | srcs = LITE_TEST_PROTOS + TEST_PROTOS, |
Jisi Liu | 3101e73 | 2015-10-16 12:46:26 -0700 | [diff] [blame] | 556 | include = "src", |
Jisi Liu | be92ffb | 2015-10-27 15:11:38 -0700 | [diff] [blame] | 557 | default_runtime = ":protobuf", |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 558 | protoc = ":protoc", |
Jisi Liu | d8701b5 | 2015-10-16 11:44:21 -0700 | [diff] [blame] | 559 | deps = [":cc_wkt_protos"], |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 560 | ) |
| 561 | |
| 562 | COMMON_TEST_SRCS = [ |
| 563 | # AUTOGEN(common_test_srcs) |
| 564 | "src/google/protobuf/arena_test_util.cc", |
Yannic Bonenberger | 4979489 | 2019-07-20 12:49:03 +0200 | [diff] [blame] | 565 | "src/google/protobuf/map_test_util.inc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 566 | "src/google/protobuf/test_util.cc", |
Adam Cozzette | 5bed368 | 2018-03-23 10:19:04 -0700 | [diff] [blame] | 567 | "src/google/protobuf/test_util.inc", |
Jisi Liu | d19604f | 2015-06-17 17:37:58 -0700 | [diff] [blame] | 568 | "src/google/protobuf/testing/file.cc", |
| 569 | "src/google/protobuf/testing/googletest.cc", |
| 570 | ] |
| 571 | |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 572 | cc_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", |
Yannic | 2e51ad6 | 2020-03-03 00:15:22 +0100 | [diff] [blame] | 583 | ] + GTEST, |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 584 | ) |
| 585 | |
| 586 | cc_test( |
Jisi Liu | 759245a | 2017-07-25 11:52:33 -0700 | [diff] [blame] | 587 | name = "win32_test", |
Hao Nguyen | ef1e8e7 | 2019-04-09 06:48:01 -0700 | [diff] [blame] | 588 | srcs = ["src/google/protobuf/io/io_win32_unittest.cc"], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 589 | tags = [ |
| 590 | "manual", |
| 591 | "windows", |
| 592 | ], |
Jisi Liu | 759245a | 2017-07-25 11:52:33 -0700 | [diff] [blame] | 593 | deps = [ |
| 594 | ":protobuf_lite", |
Yannic | 2e51ad6 | 2020-03-03 00:15:22 +0100 | [diff] [blame] | 595 | ] + GTEST_MAIN, |
Jisi Liu | 759245a | 2017-07-25 11:52:33 -0700 | [diff] [blame] | 596 | ) |
| 597 | |
| 598 | cc_test( |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 599 | name = "protobuf_test", |
Jisi Liu | 39362b3 | 2015-10-14 17:12:11 -0700 | [diff] [blame] | 600 | srcs = COMMON_TEST_SRCS + [ |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 601 | # 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 Liu | 1c682e0 | 2017-10-18 14:31:23 -0700 | [diff] [blame] | 605 | "src/google/protobuf/compiler/annotation_test_util.cc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 606 | "src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc", |
Jisi Liu | 11b6661 | 2017-07-19 12:10:43 -0700 | [diff] [blame] | 607 | "src/google/protobuf/compiler/cpp/cpp_move_unittest.cc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 608 | "src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc", |
| 609 | "src/google/protobuf/compiler/cpp/cpp_unittest.cc", |
Adam Cozzette | 5bed368 | 2018-03-23 10:19:04 -0700 | [diff] [blame] | 610 | "src/google/protobuf/compiler/cpp/cpp_unittest.inc", |
Jisi Liu | 1f4f3e2 | 2016-04-18 14:12:08 -0700 | [diff] [blame] | 611 | "src/google/protobuf/compiler/cpp/metadata_test.cc", |
Feng Xiao | 32d7830 | 2017-03-29 14:01:40 -0700 | [diff] [blame] | 612 | "src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 613 | "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 Nguyen | ef1e8e7 | 2019-04-09 06:48:01 -0700 | [diff] [blame] | 629 | "src/google/protobuf/io/io_win32_unittest.cc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 630 | "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 Cozzette | 5bed368 | 2018-03-23 10:19:04 -0700 | [diff] [blame] | 636 | "src/google/protobuf/message_unittest.inc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 637 | "src/google/protobuf/no_field_presence_test.cc", |
| 638 | "src/google/protobuf/preserve_unknown_enum_test.cc", |
Chad Whipkey | baf52bd | 2016-04-15 09:23:50 -0700 | [diff] [blame] | 639 | "src/google/protobuf/proto3_arena_lite_unittest.cc", |
Jisi Liu | f86d39c | 2016-04-28 14:43:22 -0700 | [diff] [blame] | 640 | "src/google/protobuf/proto3_arena_unittest.cc", |
Chad Whipkey | baf52bd | 2016-04-15 09:23:50 -0700 | [diff] [blame] | 641 | "src/google/protobuf/proto3_lite_unittest.cc", |
Feng Xiao | bde4eaf | 2018-08-13 12:58:55 -0700 | [diff] [blame] | 642 | "src/google/protobuf/proto3_lite_unittest.inc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 643 | "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 Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 648 | "src/google/protobuf/stubs/int128_unittest.cc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 649 | "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 Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 657 | "src/google/protobuf/text_format_unittest.cc", |
| 658 | "src/google/protobuf/unknown_field_set_unittest.cc", |
Byron Yi | cb3e84b | 2017-03-16 20:01:22 +0800 | [diff] [blame] | 659 | "src/google/protobuf/util/delimited_message_util_test.cc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 660 | "src/google/protobuf/util/field_comparator_test.cc", |
Jisi Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 661 | "src/google/protobuf/util/field_mask_util_test.cc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 662 | "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 Xiao | ef6c72b | 2015-12-28 17:33:55 -0800 | [diff] [blame] | 669 | "src/google/protobuf/util/message_differencer_unittest.cc", |
Jisi Liu | b90f9f8 | 2015-08-25 17:06:33 -0700 | [diff] [blame] | 670 | "src/google/protobuf/util/time_util_test.cc", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 671 | "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 Peng | 073487b | 2018-12-14 12:53:36 +0100 | [diff] [blame] | 674 | ] + select({ |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 675 | "//conditions:default": [ |
Yannic Bonenberger | 4979489 | 2019-07-20 12:49:03 +0200 | [diff] [blame] | 676 | # AUTOGEN(non_msvc_test_srcs) |
Yun Peng | 073487b | 2018-12-14 12:53:36 +0100 | [diff] [blame] | 677 | "src/google/protobuf/compiler/command_line_interface_unittest.cc", |
| 678 | ], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 679 | ":msvc": [], |
Yun Peng | 073487b | 2018-12-14 12:53:36 +0100 | [diff] [blame] | 680 | }), |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 681 | copts = COPTS, |
| 682 | data = [ |
| 683 | ":test_plugin", |
Jisi Liu | 598480d | 2015-10-21 11:19:16 -0700 | [diff] [blame] | 684 | ] + glob([ |
| 685 | "src/google/protobuf/**/*", |
Feng Xiao | acde165 | 2017-03-29 15:14:18 -0700 | [diff] [blame] | 686 | # Files for csharp_bootstrap_unittest.cc. |
| 687 | "conformance/**/*", |
| 688 | "csharp/src/**/*", |
Jisi Liu | 598480d | 2015-10-21 11:19:16 -0700 | [diff] [blame] | 689 | ]), |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 690 | includes = [ |
| 691 | "src/", |
| 692 | ], |
| 693 | linkopts = LINK_OPTS, |
| 694 | deps = [ |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 695 | ":cc_test_protos", |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 696 | ":protobuf", |
| 697 | ":protoc_lib", |
Yannic | 2e51ad6 | 2020-03-03 00:15:22 +0100 | [diff] [blame] | 698 | ] + PROTOBUF_DEPS + GTEST_MAIN, |
Jisi Liu | 7a0c431 | 2015-06-18 16:45:27 -0700 | [diff] [blame] | 699 | ) |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 700 | |
| 701 | ################################################################################ |
| 702 | # Java support |
| 703 | ################################################################################ |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 704 | |
Steven Parkes | ea18866 | 2016-02-25 07:53:19 -0800 | [diff] [blame] | 705 | internal_gen_well_known_protos_java( |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 706 | 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 Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 711 | ) |
| 712 | |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 713 | alias( |
Jisi Liu | 166e9bb | 2015-10-21 10:56:38 -0700 | [diff] [blame] | 714 | name = "protobuf_java", |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 715 | actual = "//java/core", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 716 | visibility = ["//visibility:public"], |
| 717 | ) |
| 718 | |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 719 | alias( |
Carmi Grushko | 5c25f41 | 2019-05-24 17:26:07 +0300 | [diff] [blame] | 720 | name = "protobuf_javalite", |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 721 | actual = "//java/lite", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 722 | visibility = ["//visibility:public"], |
| 723 | ) |
| 724 | |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 725 | alias( |
Steven Parkes | a9244ca | 2016-03-10 17:50:25 -0800 | [diff] [blame] | 726 | name = "protobuf_java_util", |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 727 | actual = "//java/util", |
Manjunath Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 728 | visibility = ["//visibility:public"], |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 729 | ) |
| 730 | |
| 731 | alias( |
| 732 | name = "java_toolchain", |
| 733 | actual = "//java/core:toolchain", |
| 734 | visibility = ["//visibility:public"], |
| 735 | ) |
| 736 | |
| 737 | alias( |
| 738 | name = "javalite_toolchain", |
| 739 | actual = "//java/lite:toolchain", |
| 740 | visibility = ["//visibility:public"], |
Steven Parkes | a9244ca | 2016-03-10 17:50:25 -0800 | [diff] [blame] | 741 | ) |
| 742 | |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 743 | ################################################################################ |
| 744 | # Python support |
| 745 | ################################################################################ |
| 746 | |
David Z. Chen | 985c968 | 2016-02-11 18:11:10 -0800 | [diff] [blame] | 747 | py_library( |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 748 | name = "python_srcs", |
| 749 | srcs = glob( |
| 750 | [ |
David L. Jones | 0295562 | 2020-09-23 15:20:38 -0700 | [diff] [blame] | 751 | "python/google/protobuf/**/*.py", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 752 | ], |
| 753 | exclude = [ |
| 754 | "python/google/protobuf/internal/*_test.py", |
| 755 | "python/google/protobuf/internal/test_util.py", |
| 756 | ], |
| 757 | ), |
David Z. Chen | 985c968 | 2016-02-11 18:11:10 -0800 | [diff] [blame] | 758 | imports = ["python"], |
Manjunath Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 759 | srcs_version = "PY2AND3", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 760 | ) |
| 761 | |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 762 | cc_binary( |
Richard Shin | df5841f | 2016-10-18 13:16:44 -0700 | [diff] [blame] | 763 | name = "python/google/protobuf/internal/_api_implementation.so", |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 764 | srcs = ["python/google/protobuf/internal/api_implementation.cc"], |
| 765 | copts = COPTS + [ |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 766 | "-DPYTHON_PROTO2_CPP_IMPL_V2", |
| 767 | ], |
Joshua Haberman | de37123 | 2020-10-21 10:04:14 -0700 | [diff] [blame] | 768 | 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 Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 775 | linkshared = 1, |
| 776 | linkstatic = 1, |
Manjunath Kudlur | a194921 | 2015-12-08 08:24:37 -0800 | [diff] [blame] | 777 | deps = select({ |
| 778 | "//conditions:default": [], |
David Z. Chen | 985c968 | 2016-02-11 18:11:10 -0800 | [diff] [blame] | 779 | ":use_fast_cpp_protos": ["//external:python_headers"], |
Manjunath Kudlur | a194921 | 2015-12-08 08:24:37 -0800 | [diff] [blame] | 780 | }), |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 781 | ) |
| 782 | |
| 783 | cc_binary( |
Richard Shin | df5841f | 2016-10-18 13:16:44 -0700 | [diff] [blame] | 784 | name = "python/google/protobuf/pyext/_message.so", |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 785 | 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 Kudlur | 99a3e30 | 2016-02-16 15:17:10 -0800 | [diff] [blame] | 791 | ] + select({ |
| 792 | "//conditions:default": [], |
| 793 | ":allow_oversize_protos": ["-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1"], |
| 794 | }), |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 795 | includes = [ |
| 796 | "python/", |
| 797 | "src/", |
| 798 | ], |
Joshua Haberman | de37123 | 2020-10-21 10:04:14 -0700 | [diff] [blame] | 799 | 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 Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 806 | linkshared = 1, |
| 807 | linkstatic = 1, |
Manjunath Kudlur | a194921 | 2015-12-08 08:24:37 -0800 | [diff] [blame] | 808 | deps = [ |
| 809 | ":protobuf", |
Thomas Colthurst | 7c65142 | 2018-05-29 18:26:11 -0400 | [diff] [blame] | 810 | ":proto_api", |
Manjunath Kudlur | a194921 | 2015-12-08 08:24:37 -0800 | [diff] [blame] | 811 | ] + select({ |
| 812 | "//conditions:default": [], |
David Z. Chen | 985c968 | 2016-02-11 18:11:10 -0800 | [diff] [blame] | 813 | ":use_fast_cpp_protos": ["//external:python_headers"], |
Manjunath Kudlur | a194921 | 2015-12-08 08:24:37 -0800 | [diff] [blame] | 814 | }), |
| 815 | ) |
| 816 | |
| 817 | config_setting( |
| 818 | name = "use_fast_cpp_protos", |
| 819 | values = { |
| 820 | "define": "use_fast_cpp_protos=true", |
| 821 | }, |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 822 | visibility = [ |
| 823 | # Public, but Protobuf only visibility. |
| 824 | "//:__subpackages__", |
| 825 | ], |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 826 | ) |
| 827 | |
Manjunath Kudlur | 99a3e30 | 2016-02-16 15:17:10 -0800 | [diff] [blame] | 828 | config_setting( |
| 829 | name = "allow_oversize_protos", |
| 830 | values = { |
| 831 | "define": "allow_oversize_protos=true", |
| 832 | }, |
Yannic | f0cb9cd | 2020-02-13 22:04:14 +0100 | [diff] [blame] | 833 | visibility = [ |
| 834 | # Public, but Protobuf only visibility. |
| 835 | "//:__subpackages__", |
| 836 | ], |
Manjunath Kudlur | 99a3e30 | 2016-02-16 15:17:10 -0800 | [diff] [blame] | 837 | ) |
| 838 | |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 839 | # 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. |
| 844 | internal_copied_filegroup( |
| 845 | name = "protos_python", |
| 846 | srcs = WELL_KNOWN_PROTOS, |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 847 | dest = "python", |
Manjunath Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 848 | strip_prefix = "src", |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 849 | ) |
| 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 Bonenberger | a03d332 | 2019-07-18 15:55:47 +0200 | [diff] [blame] | 853 | COPIED_WELL_KNOWN_PROTOS = ["python/" + s[4:] for s in WELL_KNOWN_PROTOS] |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 854 | |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 855 | py_proto_library( |
Jisi Liu | 166e9bb | 2015-10-21 10:56:38 -0700 | [diff] [blame] | 856 | name = "protobuf_python", |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 857 | srcs = COPIED_WELL_KNOWN_PROTOS, |
| 858 | include = "python", |
Manjunath Kudlur | a194921 | 2015-12-08 08:24:37 -0800 | [diff] [blame] | 859 | data = select({ |
| 860 | "//conditions:default": [], |
| 861 | ":use_fast_cpp_protos": [ |
Richard Shin | df5841f | 2016-10-18 13:16:44 -0700 | [diff] [blame] | 862 | ":python/google/protobuf/internal/_api_implementation.so", |
| 863 | ":python/google/protobuf/pyext/_message.so", |
Manjunath Kudlur | a194921 | 2015-12-08 08:24:37 -0800 | [diff] [blame] | 864 | ], |
| 865 | }), |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 866 | default_runtime = "", |
Jisi Liu | 04658a3 | 2015-10-20 15:00:13 -0700 | [diff] [blame] | 867 | protoc = ":protoc", |
David Z. Chen | 985c968 | 2016-02-11 18:11:10 -0800 | [diff] [blame] | 868 | py_libs = [ |
| 869 | ":python_srcs", |
Adam Liddell | a74c43b | 2019-07-15 23:35:19 +0000 | [diff] [blame] | 870 | "@six//:six", |
David Z. Chen | 985c968 | 2016-02-11 18:11:10 -0800 | [diff] [blame] | 871 | ], |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 872 | srcs_version = "PY2AND3", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 873 | visibility = ["//visibility:public"], |
| 874 | ) |
| 875 | |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 876 | # 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. |
| 881 | internal_copied_filegroup( |
| 882 | name = "protos_python_test", |
| 883 | srcs = LITE_TEST_PROTOS + TEST_PROTOS, |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 884 | dest = "python", |
Manjunath Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 885 | strip_prefix = "src", |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 886 | ) |
| 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. |
| 890 | COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS] |
Manjunath Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 891 | |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 892 | COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS] |
| 893 | |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 894 | py_proto_library( |
| 895 | name = "python_common_test_protos", |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 896 | srcs = COPIED_LITE_TEST_PROTOS + COPIED_TEST_PROTOS, |
| 897 | include = "python", |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 898 | default_runtime = "", |
Jisi Liu | 04658a3 | 2015-10-20 15:00:13 -0700 | [diff] [blame] | 899 | protoc = ":protoc", |
David Z. Chen | 5ebeefb | 2016-04-08 13:30:13 -0700 | [diff] [blame] | 900 | srcs_version = "PY2AND3", |
Jisi Liu | 166e9bb | 2015-10-21 10:56:38 -0700 | [diff] [blame] | 901 | deps = [":protobuf_python"], |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 902 | ) |
| 903 | |
| 904 | py_proto_library( |
| 905 | name = "python_specific_test_protos", |
Jisi Liu | 68e13f4 | 2015-10-22 11:13:14 -0700 | [diff] [blame] | 906 | srcs = glob([ |
| 907 | "python/google/protobuf/internal/*.proto", |
| 908 | "python/google/protobuf/internal/import_test_package/*.proto", |
| 909 | ]), |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 910 | include = "python", |
Manjunath Kudlur | 3ff1dca | 2015-12-07 13:08:21 -0800 | [diff] [blame] | 911 | default_runtime = ":protobuf_python", |
Jisi Liu | 04658a3 | 2015-10-20 15:00:13 -0700 | [diff] [blame] | 912 | protoc = ":protoc", |
David Z. Chen | 5ebeefb | 2016-04-08 13:30:13 -0700 | [diff] [blame] | 913 | srcs_version = "PY2AND3", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 914 | deps = [":python_common_test_protos"], |
| 915 | ) |
| 916 | |
| 917 | py_library( |
| 918 | name = "python_tests", |
David Z. Chen | 985c968 | 2016-02-11 18:11:10 -0800 | [diff] [blame] | 919 | srcs = glob( |
| 920 | [ |
| 921 | "python/google/protobuf/internal/*_test.py", |
| 922 | "python/google/protobuf/internal/test_util.py", |
David Z. Chen | 02cd45c | 2016-05-20 16:49:04 -0700 | [diff] [blame] | 923 | "python/google/protobuf/internal/import_test_package/__init__.py", |
David Z. Chen | 985c968 | 2016-02-11 18:11:10 -0800 | [diff] [blame] | 924 | ], |
| 925 | ), |
| 926 | imports = ["python"], |
Geoffrey Irving | 2979923 | 2015-12-03 13:11:19 -0800 | [diff] [blame] | 927 | srcs_version = "PY2AND3", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 928 | deps = [ |
Jisi Liu | 166e9bb | 2015-10-21 10:56:38 -0700 | [diff] [blame] | 929 | ":protobuf_python", |
Jisi Liu | 598480d | 2015-10-21 11:19:16 -0700 | [diff] [blame] | 930 | ":python_common_test_protos", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 931 | ":python_specific_test_protos", |
| 932 | ], |
| 933 | ) |
| 934 | |
| 935 | internal_protobuf_py_tests( |
Jisi Liu | 8f54026 | 2015-10-20 16:21:41 -0700 | [diff] [blame] | 936 | name = "python_tests_batch", |
Jisi Liu | 68e13f4 | 2015-10-22 11:13:14 -0700 | [diff] [blame] | 937 | data = glob([ |
| 938 | "src/google/protobuf/**/*", |
| 939 | ]), |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 940 | modules = [ |
| 941 | "descriptor_database_test", |
| 942 | "descriptor_pool_test", |
| 943 | "descriptor_test", |
| 944 | "generator_test", |
| 945 | "json_format_test", |
| 946 | "message_factory_test", |
Jisi Liu | 68e13f4 | 2015-10-22 11:13:14 -0700 | [diff] [blame] | 947 | "message_test", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 948 | "proto_builder_test", |
Jisi Liu | 68e13f4 | 2015-10-22 11:13:14 -0700 | [diff] [blame] | 949 | "reflection_test", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 950 | "service_reflection_test", |
| 951 | "symbol_database_test", |
| 952 | "text_encoding_test", |
Jisi Liu | 68e13f4 | 2015-10-22 11:13:14 -0700 | [diff] [blame] | 953 | "text_format_test", |
Jisi Liu | 993fb70 | 2015-10-19 17:19:49 -0700 | [diff] [blame] | 954 | "unknown_fields_test", |
| 955 | "wire_format_test", |
| 956 | ], |
| 957 | deps = [":python_tests"], |
| 958 | ) |
cgrushko | 45d92ae | 2016-12-02 19:40:50 -0500 | [diff] [blame] | 959 | |
Thomas Colthurst | 7c65142 | 2018-05-29 18:26:11 -0400 | [diff] [blame] | 960 | cc_library( |
| 961 | name = "proto_api", |
| 962 | hdrs = ["python/google/protobuf/proto_api.h"], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 963 | visibility = ["//visibility:public"], |
Thomas Colthurst | 7c65142 | 2018-05-29 18:26:11 -0400 | [diff] [blame] | 964 | deps = [ |
Thomas Colthurst | 7c65142 | 2018-05-29 18:26:11 -0400 | [diff] [blame] | 965 | "//external:python_headers", |
| 966 | ], |
| 967 | ) |
| 968 | |
cgrushko | 45d92ae | 2016-12-02 19:40:50 -0500 | [diff] [blame] | 969 | proto_lang_toolchain( |
Manjunath Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 970 | name = "cc_toolchain", |
Yannic | cdc7fe8 | 2020-06-26 19:07:17 +0200 | [diff] [blame] | 971 | blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], |
Manjunath Kudlur | 2d430f8 | 2017-02-23 08:17:24 -0800 | [diff] [blame] | 972 | command_line = "--cpp_out=$(OUT)", |
| 973 | runtime = ":protobuf", |
| 974 | visibility = ["//visibility:public"], |
cgrushko | 45d92ae | 2016-12-02 19:40:50 -0500 | [diff] [blame] | 975 | ) |
cgrushko | e4baf3f | 2017-01-12 12:51:04 -0500 | [diff] [blame] | 976 | |
Thomas Van Lenten | 18aa296 | 2018-11-01 09:37:14 -0400 | [diff] [blame] | 977 | alias( |
| 978 | name = "objectivec", |
Yannic Bonenberger | 8b93b8e | 2020-07-08 17:21:38 +0200 | [diff] [blame] | 979 | actual = "//objectivec", |
Thomas Van Lenten | 18aa296 | 2018-11-01 09:37:14 -0400 | [diff] [blame] | 980 | visibility = ["//visibility:public"], |
| 981 | ) |
makdharma | 286f059 | 2017-05-01 09:49:26 -0700 | [diff] [blame] | 982 | |
Yannic Bonenberger | 8b93b8e | 2020-07-08 17:21:38 +0200 | [diff] [blame] | 983 | alias( |
Thomas Van Lenten | 18aa296 | 2018-11-01 09:37:14 -0400 | [diff] [blame] | 984 | name = "protobuf_objc", |
Yannic Bonenberger | 8b93b8e | 2020-07-08 17:21:38 +0200 | [diff] [blame] | 985 | actual = "//objectivec", |
makdharma | 286f059 | 2017-05-01 09:49:26 -0700 | [diff] [blame] | 986 | visibility = ["//visibility:public"], |
| 987 | ) |
Fahrzin Hemmati | 0d68b29 | 2018-03-26 19:08:26 -0700 | [diff] [blame] | 988 | |
| 989 | ################################################################################ |
| 990 | # Test generated proto support |
| 991 | ################################################################################ |
| 992 | |
| 993 | genrule( |
| 994 | name = "generated_protos", |
| 995 | srcs = ["src/google/protobuf/unittest_import.proto"], |
| 996 | outs = ["unittest_gen.proto"], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 997 | cmd = "cat $(SRCS) | sed 's|google/|src/google/|' > $(OUTS)", |
Fahrzin Hemmati | 0d68b29 | 2018-03-26 19:08:26 -0700 | [diff] [blame] | 998 | ) |
| 999 | |
| 1000 | proto_library( |
| 1001 | name = "generated_protos_proto", |
Fahrzin Hemmati | 55962db | 2018-05-07 17:36:34 -0700 | [diff] [blame] | 1002 | srcs = [ |
Fahrzin Hemmati | 55962db | 2018-05-07 17:36:34 -0700 | [diff] [blame] | 1003 | "src/google/protobuf/unittest_import_public.proto", |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 1004 | "unittest_gen.proto", |
Fahrzin Hemmati | 55962db | 2018-05-07 17:36:34 -0700 | [diff] [blame] | 1005 | ], |
Fahrzin Hemmati | 0d68b29 | 2018-03-26 19:08:26 -0700 | [diff] [blame] | 1006 | ) |
| 1007 | |
Fahrzin Hemmati | 0d68b29 | 2018-03-26 19:08:26 -0700 | [diff] [blame] | 1008 | py_proto_library( |
| 1009 | name = "generated_protos_py", |
| 1010 | srcs = [ |
Fahrzin Hemmati | 0d68b29 | 2018-03-26 19:08:26 -0700 | [diff] [blame] | 1011 | "src/google/protobuf/unittest_import_public.proto", |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 1012 | "unittest_gen.proto", |
Fahrzin Hemmati | 0d68b29 | 2018-03-26 19:08:26 -0700 | [diff] [blame] | 1013 | ], |
| 1014 | default_runtime = "", |
| 1015 | protoc = ":protoc", |
| 1016 | ) |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1017 | |
| 1018 | ################################################################################ |
| 1019 | # Conformance tests |
| 1020 | ################################################################################ |
| 1021 | |
| 1022 | proto_library( |
| 1023 | name = "test_messages_proto2_proto", |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1024 | srcs = ["src/google/protobuf/test_messages_proto2.proto"], |
Josh Haberman | 25feb59 | 2018-11-03 14:43:20 -0700 | [diff] [blame] | 1025 | visibility = ["//visibility:public"], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1026 | ) |
| 1027 | |
| 1028 | proto_library( |
| 1029 | name = "test_messages_proto3_proto", |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1030 | srcs = ["src/google/protobuf/test_messages_proto3.proto"], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 1031 | visibility = ["//visibility:public"], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1032 | deps = [ |
| 1033 | ":any_proto", |
| 1034 | ":duration_proto", |
| 1035 | ":field_mask_proto", |
| 1036 | ":struct_proto", |
| 1037 | ":timestamp_proto", |
| 1038 | ":wrappers_proto", |
| 1039 | ], |
| 1040 | ) |
| 1041 | |
| 1042 | cc_proto_library( |
| 1043 | name = "test_messages_proto2_proto_cc", |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1044 | srcs = ["src/google/protobuf/test_messages_proto2.proto"], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1045 | ) |
| 1046 | |
| 1047 | cc_proto_library( |
| 1048 | name = "test_messages_proto3_proto_cc", |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1049 | srcs = ["src/google/protobuf/test_messages_proto3.proto"], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1050 | deps = [ |
| 1051 | ":cc_wkt_protos", |
| 1052 | ], |
| 1053 | ) |
| 1054 | |
| 1055 | proto_library( |
| 1056 | name = "conformance_proto", |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1057 | srcs = ["conformance/conformance.proto"], |
Josh Haberman | 25feb59 | 2018-11-03 14:43:20 -0700 | [diff] [blame] | 1058 | visibility = ["//visibility:public"], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1059 | ) |
| 1060 | |
| 1061 | cc_proto_library( |
| 1062 | name = "conformance_proto_cc", |
| 1063 | srcs = ["conformance/conformance.proto"], |
| 1064 | ) |
| 1065 | |
| 1066 | cc_library( |
| 1067 | name = "jsoncpp", |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1068 | srcs = ["conformance/third_party/jsoncpp/jsoncpp.cpp"], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 1069 | hdrs = ["conformance/third_party/jsoncpp/json.h"], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1070 | includes = ["conformance"], |
| 1071 | ) |
| 1072 | |
| 1073 | cc_library( |
| 1074 | name = "conformance_test", |
| 1075 | srcs = [ |
| 1076 | "conformance/conformance_test.cc", |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1077 | "conformance/conformance_test_runner.cc", |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1078 | ], |
| 1079 | hdrs = [ |
| 1080 | "conformance/conformance_test.h", |
| 1081 | ], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 1082 | includes = [ |
| 1083 | "conformance", |
| 1084 | "src", |
| 1085 | ], |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1086 | deps = [":conformance_proto_cc"], |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1087 | ) |
| 1088 | |
| 1089 | cc_library( |
| 1090 | name = "binary_json_conformance_suite", |
| 1091 | srcs = ["conformance/binary_json_conformance_suite.cc"], |
| 1092 | hdrs = ["conformance/binary_json_conformance_suite.h"], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1093 | deps = [ |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1094 | ":conformance_test", |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1095 | ":jsoncpp", |
| 1096 | ":test_messages_proto2_proto_cc", |
| 1097 | ":test_messages_proto3_proto_cc", |
| 1098 | ], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1099 | ) |
| 1100 | |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1101 | cc_library( |
| 1102 | name = "text_format_conformance_suite", |
| 1103 | srcs = ["conformance/text_format_conformance_suite.cc"], |
| 1104 | hdrs = ["conformance/text_format_conformance_suite.h"], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1105 | deps = [ |
| 1106 | ":conformance_test", |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1107 | ":test_messages_proto2_proto_cc", |
| 1108 | ":test_messages_proto3_proto_cc", |
| 1109 | ], |
| 1110 | ) |
| 1111 | |
Joshua Haberman | c659a4a | 2019-05-14 14:01:16 -0700 | [diff] [blame] | 1112 | cc_binary( |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1113 | name = "conformance_test_runner", |
| 1114 | srcs = ["conformance/conformance_test_main.cc"], |
Liam Miller-Cushon | 2b857d0 | 2019-07-01 12:21:04 -0700 | [diff] [blame] | 1115 | visibility = ["//visibility:public"], |
Joshua Haberman | 2996da4 | 2019-05-13 07:45:30 -0700 | [diff] [blame] | 1116 | deps = [ |
| 1117 | ":binary_json_conformance_suite", |
| 1118 | ":conformance_test", |
| 1119 | ":text_format_conformance_suite", |
Josh Haberman | 25feb59 | 2018-11-03 14:43:20 -0700 | [diff] [blame] | 1120 | ], |
Josh Haberman | 6dec8cf | 2018-11-03 12:59:45 -0700 | [diff] [blame] | 1121 | ) |
Yannic Bonenberger | 4979489 | 2019-07-20 12:49:03 +0200 | [diff] [blame] | 1122 | |
| 1123 | sh_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 | ) |