Joshua Haberman | 823eb09 | 2021-04-05 12:26:41 -0700 | [diff] [blame] | 1 | # Copyright (c) 2009-2021, Google LLC |
Joshua Haberman | e59d2c8 | 2021-04-05 10:47:53 -0700 | [diff] [blame] | 2 | # All rights reserved. |
| 3 | # |
| 4 | # Redistribution and use in source and binary forms, with or without |
| 5 | # modification, are permitted provided that the following conditions are met: |
| 6 | # * Redistributions of source code must retain the above copyright |
| 7 | # notice, this list of conditions and the following disclaimer. |
| 8 | # * Redistributions in binary form must reproduce the above copyright |
| 9 | # notice, this list of conditions and the following disclaimer in the |
| 10 | # documentation and/or other materials provided with the distribution. |
| 11 | # * Neither the name of Google LLC nor the |
| 12 | # names of its contributors may be used to endorse or promote products |
| 13 | # derived from this software without specific prior written permission. |
| 14 | # |
| 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 16 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 17 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 18 | # DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY |
| 19 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 20 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 21 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 22 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 24 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 | |
Josh Haberman | 2655ed9 | 2018-11-03 13:04:10 -0700 | [diff] [blame] | 26 | load( |
Joshua Haberman | 5611ff2 | 2019-05-16 11:35:00 -0700 | [diff] [blame] | 27 | "//bazel:build_defs.bzl", |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 28 | "UPB_DEFAULT_COPTS", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 29 | "UPB_DEFAULT_CPPOPTS", |
| 30 | "make_shell_script", |
Joshua Haberman | 06b90f9 | 2019-05-14 15:58:58 -0700 | [diff] [blame] | 31 | ) |
Joshua Haberman | 06b90f9 | 2019-05-14 15:58:58 -0700 | [diff] [blame] | 32 | load( |
Joshua Haberman | 5611ff2 | 2019-05-16 11:35:00 -0700 | [diff] [blame] | 33 | "//bazel:upb_proto_library.bzl", |
Joshua Haberman | a345af9 | 2020-10-18 13:39:13 -0700 | [diff] [blame] | 34 | "upb_fasttable_enabled", |
Josh Haberman | a7ebe54 | 2018-11-03 18:18:47 -0700 | [diff] [blame] | 35 | "upb_proto_library", |
Joshua Haberman | a274ad7 | 2020-10-28 13:06:30 -0700 | [diff] [blame] | 36 | "upb_proto_library_copts", |
Joshua Haberman | e8f9eac | 2020-10-28 22:50:03 -0700 | [diff] [blame] | 37 | "upb_proto_reflection_library", |
Josh Haberman | 2655ed9 | 2018-11-03 13:04:10 -0700 | [diff] [blame] | 38 | ) |
Joshua Haberman | 0dc2394 | 2020-06-05 09:17:33 -0700 | [diff] [blame] | 39 | |
Protobuf Team | b8edc71 | 2022-03-16 08:24:52 -0700 | [diff] [blame] | 40 | # begin:github_only |
| 41 | load( |
| 42 | "//bazel:build_defs.bzl", |
| 43 | "upb_amalgamation", |
| 44 | ) |
| 45 | # end:github_only |
| 46 | |
Joshua Haberman | 83c0edb | 2021-02-28 16:56:49 -0800 | [diff] [blame] | 47 | licenses(["notice"]) |
Joshua Haberman | 7f9f722 | 2019-01-23 17:10:22 -0800 | [diff] [blame] | 48 | |
Joshua Haberman | a5243ff | 2022-03-30 14:20:07 -0700 | [diff] [blame] | 49 | exports_files(["LICENSE"]) |
| 50 | |
| 51 | exports_files( |
| 52 | [ |
| 53 | "BUILD", |
| 54 | "WORKSPACE", |
| 55 | ], |
| 56 | visibility = ["//cmake:__pkg__"], |
| 57 | ) |
Joshua Haberman | 7f9f722 | 2019-01-23 17:10:22 -0800 | [diff] [blame] | 58 | |
Joshua Haberman | 00f96cb | 2019-03-27 12:13:59 -0700 | [diff] [blame] | 59 | config_setting( |
Nicolas "Pixel" Noble | ce3ba4d | 2019-07-18 01:12:00 +0200 | [diff] [blame] | 60 | name = "windows", |
Protobuf Team | e5f2601 | 2022-06-01 14:40:00 -0700 | [diff] [blame] | 61 | constraint_values = ["@platforms//os:windows"], |
Eli Schleifer | 231daa3 | 2021-12-20 16:01:23 -0800 | [diff] [blame] | 62 | visibility = ["//visibility:public"], |
Nicolas "Pixel" Noble | ce3ba4d | 2019-07-18 01:12:00 +0200 | [diff] [blame] | 63 | ) |
| 64 | |
Joshua Haberman | a345af9 | 2020-10-18 13:39:13 -0700 | [diff] [blame] | 65 | upb_fasttable_enabled( |
| 66 | name = "fasttable_enabled", |
Joshua Haberman | b928696 | 2020-10-26 21:23:16 -0700 | [diff] [blame] | 67 | build_setting_default = False, |
Joshua Haberman | a345af9 | 2020-10-18 13:39:13 -0700 | [diff] [blame] | 68 | visibility = ["//visibility:public"], |
| 69 | ) |
| 70 | |
Joshua Haberman | e8f9eac | 2020-10-28 22:50:03 -0700 | [diff] [blame] | 71 | config_setting( |
| 72 | name = "fasttable_enabled_setting", |
| 73 | flag_values = {"//:fasttable_enabled": "true"}, |
| 74 | ) |
| 75 | |
Joshua Haberman | a274ad7 | 2020-10-28 13:06:30 -0700 | [diff] [blame] | 76 | upb_proto_library_copts( |
| 77 | name = "upb_proto_library_copts__for_generated_code_only_do_not_use", |
| 78 | copts = UPB_DEFAULT_COPTS, |
| 79 | visibility = ["//visibility:public"], |
| 80 | ) |
| 81 | |
Joshua Haberman | 6df5517 | 2022-05-24 11:41:56 -0700 | [diff] [blame] | 82 | package_group( |
| 83 | name = "friends", |
| 84 | packages = [], |
| 85 | ) |
| 86 | |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 87 | # Public C/C++ libraries ####################################################### |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 88 | |
| 89 | cc_library( |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 90 | name = "port", |
Joshua Haberman | a60e9a3 | 2022-05-13 17:32:17 -0700 | [diff] [blame] | 91 | hdrs = [ |
| 92 | "upb/internal/vsnprintf_compat.h", |
| 93 | ], |
Joshua Haberman | 558315a | 2020-10-28 17:13:13 -0700 | [diff] [blame] | 94 | copts = UPB_DEFAULT_COPTS, |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 95 | textual_hdrs = [ |
| 96 | "upb/port_def.inc", |
| 97 | "upb/port_undef.inc", |
| 98 | ], |
Matt Kulukundis | c49e6df | 2022-02-21 20:12:58 -0500 | [diff] [blame] | 99 | visibility = ["//:__subpackages__"], |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 100 | ) |
| 101 | |
| 102 | cc_library( |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 103 | name = "upb", |
| 104 | srcs = [ |
Protobuf Team Bot | 7b05f25 | 2022-06-22 09:18:12 -0700 | [diff] [blame] | 105 | "upb/alloc.c", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 106 | "upb/arena.c", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 107 | "upb/decode.c", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 108 | "upb/encode.c", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 109 | "upb/internal/decode.h", |
| 110 | "upb/internal/table.h", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 111 | "upb/msg.c", |
Joshua Haberman | 3881393 | 2021-04-05 16:00:25 -0700 | [diff] [blame] | 112 | "upb/msg_internal.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 113 | "upb/status.c", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 114 | "upb/upb.c", |
| 115 | ], |
| 116 | hdrs = [ |
Protobuf Team Bot | 7b05f25 | 2022-06-22 09:18:12 -0700 | [diff] [blame] | 117 | "upb/alloc.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 118 | "upb/arena.h", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 119 | "upb/decode.h", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 120 | "upb/encode.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 121 | "upb/extension_registry.h", |
Joshua Haberman | 1674f28 | 2021-04-04 18:43:24 -0700 | [diff] [blame] | 122 | "upb/msg.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 123 | "upb/status.h", |
Protobuf Team Bot | e153b52 | 2022-06-23 14:12:45 -0700 | [diff] [blame] | 124 | "upb/string_view.h", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 125 | "upb/upb.h", |
Joshua Haberman | 2559e78 | 2020-04-09 14:36:24 -0700 | [diff] [blame] | 126 | "upb/upb.hpp", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 127 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 128 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 129 | visibility = ["//visibility:public"], |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 130 | deps = [ |
Protobuf Team Bot | 8d0d13f | 2022-06-23 13:43:40 -0700 | [diff] [blame] | 131 | ":arena_internal", |
Protobuf Team Bot | 033859f | 2022-06-24 13:52:58 -0700 | [diff] [blame^] | 132 | ":encode_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 133 | ":extension_registry", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 134 | ":fastdecode", |
| 135 | ":port", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 136 | ":table_internal", |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 137 | "//third_party/utf8_range", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 138 | ], |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 139 | ) |
| 140 | |
| 141 | cc_library( |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 142 | name = "extension_registry", |
| 143 | srcs = [ |
| 144 | "upb/extension_registry.c", |
| 145 | "upb/msg.h", |
| 146 | "upb/msg_internal.h", |
Protobuf Team Bot | e153b52 | 2022-06-23 14:12:45 -0700 | [diff] [blame] | 147 | "upb/string_view.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 148 | "upb/upb.h", |
| 149 | ], |
| 150 | hdrs = [ |
| 151 | "upb/extension_registry.h", |
| 152 | ], |
| 153 | copts = UPB_DEFAULT_COPTS, |
| 154 | visibility = ["//visibility:public"], |
| 155 | deps = [ |
| 156 | ":port", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 157 | ":table_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 158 | ], |
| 159 | ) |
| 160 | |
| 161 | cc_library( |
Protobuf Team Bot | bb38fc9 | 2022-06-10 14:32:58 -0700 | [diff] [blame] | 162 | name = "mini_descriptor", |
| 163 | srcs = [ |
| 164 | "upb/mini_descriptor.c", |
| 165 | ], |
| 166 | hdrs = [ |
| 167 | "upb/mini_descriptor.h", |
| 168 | ], |
| 169 | copts = UPB_DEFAULT_COPTS, |
| 170 | visibility = ["//visibility:public"], |
| 171 | deps = [ |
Protobuf Team Bot | bb38fc9 | 2022-06-10 14:32:58 -0700 | [diff] [blame] | 172 | ":mini_table", |
| 173 | ":port", |
| 174 | ":reflection", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 175 | ":table_internal", |
Protobuf Team Bot | bb38fc9 | 2022-06-10 14:32:58 -0700 | [diff] [blame] | 176 | ":upb", |
| 177 | ], |
| 178 | ) |
| 179 | |
| 180 | cc_library( |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 181 | name = "mini_table_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 182 | hdrs = [ |
| 183 | "upb/msg_internal.h", |
| 184 | ], |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 185 | deps = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 186 | ":extension_registry", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 187 | ":port", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 188 | ":table_internal", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 189 | ":upb", |
| 190 | ], |
| 191 | ) |
| 192 | |
| 193 | cc_library( |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 194 | name = "mini_table", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 195 | srcs = [ |
| 196 | "upb/mini_table.c", |
| 197 | ], |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 198 | hdrs = [ |
| 199 | "upb/mini_table.h", |
| 200 | "upb/mini_table.hpp", |
| 201 | ], |
| 202 | copts = UPB_DEFAULT_COPTS, |
| 203 | visibility = ["//visibility:public"], |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 204 | deps = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 205 | ":extension_registry", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 206 | ":mini_table_internal", |
| 207 | ":port", |
| 208 | ":upb", |
| 209 | ], |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 210 | ) |
| 211 | |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 212 | cc_library( |
| 213 | name = "mini_table_accessors", |
| 214 | srcs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 215 | "upb/internal/mini_table_accessors.h", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 216 | "upb/mini_table_accessors.c", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 217 | ], |
| 218 | hdrs = [ |
| 219 | "upb/mini_table_accessors.h", |
| 220 | ], |
| 221 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 6df5517 | 2022-05-24 11:41:56 -0700 | [diff] [blame] | 222 | visibility = ["//visibility:public"], |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 223 | deps = [ |
Protobuf Team | c7620a4 | 2022-04-29 13:21:20 -0700 | [diff] [blame] | 224 | ":collections", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 225 | ":mini_table", |
| 226 | ":mini_table_internal", |
| 227 | ":port", |
| 228 | ":upb", |
| 229 | ], |
| 230 | ) |
| 231 | |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 232 | cc_test( |
| 233 | name = "mini_table_test", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 234 | srcs = [ |
| 235 | "upb/internal/table.h", |
| 236 | "upb/mini_table_test.cc", |
| 237 | ], |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 238 | deps = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 239 | ":extension_registry", |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 240 | ":mini_table", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 241 | ":mini_table_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 242 | ":port", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 243 | ":upb", |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 244 | "@com_google_absl//absl/container:flat_hash_set", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 245 | "@com_google_googletest//:gtest_main", |
Joshua Haberman | 8d148f0 | 2022-03-13 18:45:50 -0700 | [diff] [blame] | 246 | "@com_google_protobuf//:protobuf", |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 247 | ], |
| 248 | ) |
| 249 | |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 250 | cc_test( |
| 251 | name = "mini_table_accessors_test", |
| 252 | srcs = ["upb/mini_table_accessors_test.cc"], |
| 253 | deps = [ |
Protobuf Team | c7620a4 | 2022-04-29 13:21:20 -0700 | [diff] [blame] | 254 | ":collections", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 255 | ":mini_table", |
| 256 | ":mini_table_accessors", |
| 257 | ":mini_table_internal", |
| 258 | ":test_messages_proto2_proto_upb", |
| 259 | ":test_messages_proto3_proto_upb", |
Protobuf Team | 459059e | 2022-05-09 14:13:02 -0700 | [diff] [blame] | 260 | ":test_upb_proto", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 261 | ":upb", |
| 262 | "@com_google_absl//absl/container:flat_hash_set", |
| 263 | "@com_google_googletest//:gtest_main", |
| 264 | "@com_google_protobuf//:protobuf", |
| 265 | ], |
| 266 | ) |
| 267 | |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 268 | cc_library( |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 269 | name = "fastdecode", |
| 270 | srcs = [ |
Joshua Haberman | 3d437bb | 2021-10-13 09:53:36 -0700 | [diff] [blame] | 271 | "upb/decode.h", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 272 | "upb/decode_fast.c", |
| 273 | "upb/decode_fast.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 274 | "upb/internal/decode.h", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 275 | "upb/msg.h", |
Joshua Haberman | 3881393 | 2021-04-05 16:00:25 -0700 | [diff] [blame] | 276 | "upb/msg_internal.h", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 277 | ], |
Joshua Haberman | e86541a | 2020-10-28 17:53:09 -0700 | [diff] [blame] | 278 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 279 | deps = [ |
Protobuf Team Bot | 8d0d13f | 2022-06-23 13:43:40 -0700 | [diff] [blame] | 280 | ":arena_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 281 | ":extension_registry", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 282 | ":port", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 283 | ":table_internal", |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 284 | "//third_party/utf8_range", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 285 | ], |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 286 | ) |
| 287 | |
| 288 | # Common support routines used by generated code. This library has no |
| 289 | # implementation, but depends on :upb and exposes a few more hdrs. |
| 290 | # |
| 291 | # This is public only because we have no way of visibility-limiting it to |
| 292 | # upb_proto_library() only. This interface is not stable and by using it you |
| 293 | # give up any backward compatibility guarantees. |
| 294 | cc_library( |
| 295 | name = "generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 296 | hdrs = [ |
Joshua Haberman | 8c530f9 | 2022-02-22 14:50:55 -0800 | [diff] [blame] | 297 | "upb/decode.h", |
Joshua Haberman | aec762e | 2020-10-11 23:14:50 -0700 | [diff] [blame] | 298 | "upb/decode_fast.h", |
Joshua Haberman | 8c530f9 | 2022-02-22 14:50:55 -0800 | [diff] [blame] | 299 | "upb/encode.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 300 | "upb/extension_registry.h", |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 301 | "upb/msg.h", |
Joshua Haberman | 42bdfcb | 2021-04-06 09:25:28 -0700 | [diff] [blame] | 302 | "upb/msg_internal.h", |
Anna R | a27429f | 2020-01-09 14:50:03 -0800 | [diff] [blame] | 303 | "upb/port_def.inc", |
| 304 | "upb/port_undef.inc", |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 305 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 306 | copts = UPB_DEFAULT_COPTS, |
Vishal Powar | 7031f77 | 2018-11-28 15:32:16 -0800 | [diff] [blame] | 307 | visibility = ["//visibility:public"], |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 308 | deps = [ |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 309 | ":table_internal", |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 310 | ":upb", |
| 311 | ], |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 312 | ) |
| 313 | |
Joshua Haberman | 8c530f9 | 2022-02-22 14:50:55 -0800 | [diff] [blame] | 314 | cc_library( |
| 315 | name = "generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", |
| 316 | hdrs = [ |
| 317 | "upb/def.h", |
| 318 | "upb/port_def.inc", |
| 319 | "upb/port_undef.inc", |
| 320 | ], |
| 321 | copts = UPB_DEFAULT_COPTS, |
| 322 | visibility = ["//visibility:public"], |
| 323 | deps = [ |
| 324 | ":descriptor_upb_proto", |
| 325 | ":reflection", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 326 | ":table_internal", |
Joshua Haberman | 8c530f9 | 2022-02-22 14:50:55 -0800 | [diff] [blame] | 327 | ], |
| 328 | ) |
| 329 | |
Josh Haberman | cd9e1e6 | 2019-04-17 15:23:00 -0700 | [diff] [blame] | 330 | upb_proto_library( |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 331 | name = "descriptor_upb_proto", |
| 332 | visibility = ["//visibility:public"], |
| 333 | deps = ["@com_google_protobuf//:descriptor_proto"], |
| 334 | ) |
| 335 | |
| 336 | upb_proto_reflection_library( |
| 337 | name = "descriptor_upb_proto_reflection", |
Joshua Haberman | c58541e | 2019-05-15 09:49:29 -0700 | [diff] [blame] | 338 | visibility = ["//visibility:public"], |
Google-Autofuzz | 8f19667 | 2019-06-25 20:14:14 -0400 | [diff] [blame] | 339 | deps = ["@com_google_protobuf//:descriptor_proto"], |
Josh Haberman | cd9e1e6 | 2019-04-17 15:23:00 -0700 | [diff] [blame] | 340 | ) |
| 341 | |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 342 | cc_library( |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 343 | name = "collections", |
| 344 | srcs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 345 | "upb/array.c", |
| 346 | "upb/map.c", |
Protobuf Team Bot | 7975945 | 2022-06-23 16:51:15 -0700 | [diff] [blame] | 347 | "upb/msg_internal.h", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 348 | ], |
| 349 | hdrs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 350 | "upb/array.h", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 351 | "upb/collections.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 352 | "upb/map.h", |
| 353 | "upb/message_value.h", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 354 | ], |
| 355 | copts = UPB_DEFAULT_COPTS, |
| 356 | visibility = ["//visibility:public"], |
| 357 | deps = [ |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 358 | ":mini_table", |
| 359 | ":port", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 360 | ":table_internal", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 361 | ":upb", |
| 362 | ], |
| 363 | ) |
| 364 | |
| 365 | cc_library( |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 366 | name = "reflection", |
| 367 | srcs = [ |
| 368 | "upb/def.c", |
Joshua Haberman | 58010a3 | 2020-02-18 16:53:21 -0800 | [diff] [blame] | 369 | "upb/msg.h", |
Joshua Haberman | 9a360ad | 2019-11-12 08:08:46 -0800 | [diff] [blame] | 370 | "upb/reflection.c", |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 371 | ], |
| 372 | hdrs = [ |
| 373 | "upb/def.h", |
Joshua Haberman | 2559e78 | 2020-04-09 14:36:24 -0700 | [diff] [blame] | 374 | "upb/def.hpp", |
Joshua Haberman | 9a360ad | 2019-11-12 08:08:46 -0800 | [diff] [blame] | 375 | "upb/reflection.h", |
Joshua Haberman | 5e550e8 | 2021-01-09 15:45:44 -0800 | [diff] [blame] | 376 | "upb/reflection.hpp", |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 377 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 378 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 379 | visibility = ["//visibility:public"], |
Josh Haberman | cd9e1e6 | 2019-04-17 15:23:00 -0700 | [diff] [blame] | 380 | deps = [ |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 381 | ":collections", |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 382 | ":descriptor_upb_proto", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 383 | ":mini_table", |
Anna R | fc49411 | 2020-01-09 14:16:25 -0800 | [diff] [blame] | 384 | ":port", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 385 | ":table_internal", |
Joshua Haberman | 9a66356 | 2019-05-13 16:13:39 -0700 | [diff] [blame] | 386 | ":upb", |
Josh Haberman | cd9e1e6 | 2019-04-17 15:23:00 -0700 | [diff] [blame] | 387 | ], |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 388 | ) |
| 389 | |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 390 | cc_library( |
| 391 | name = "textformat", |
| 392 | srcs = [ |
Joshua Haberman | 02c89a8 | 2020-02-10 14:56:27 -0800 | [diff] [blame] | 393 | "upb/text_encode.c", |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 394 | ], |
| 395 | hdrs = [ |
Joshua Haberman | 02c89a8 | 2020-02-10 14:56:27 -0800 | [diff] [blame] | 396 | "upb/text_encode.h", |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 397 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 398 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 399 | visibility = ["//visibility:public"], |
| 400 | deps = [ |
Protobuf Team Bot | 033859f | 2022-06-24 13:52:58 -0700 | [diff] [blame^] | 401 | ":encode_internal", |
Joshua Haberman | 4b8c04e | 2020-02-18 16:50:25 -0800 | [diff] [blame] | 402 | ":port", |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 403 | ":reflection", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 404 | ":table_internal", |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 405 | ], |
| 406 | ) |
| 407 | |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 408 | cc_library( |
| 409 | name = "json", |
| 410 | srcs = [ |
Joshua Haberman | d49c1db | 2020-02-23 19:49:39 -0800 | [diff] [blame] | 411 | "upb/json_decode.c", |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 412 | "upb/json_encode.c", |
| 413 | ], |
| 414 | hdrs = [ |
Joshua Haberman | d49c1db | 2020-02-23 19:49:39 -0800 | [diff] [blame] | 415 | "upb/json_decode.h", |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 416 | "upb/json_encode.h", |
| 417 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 418 | copts = UPB_DEFAULT_COPTS, |
Lidi Zheng | f72c26c | 2020-12-10 16:23:08 -0800 | [diff] [blame] | 419 | visibility = ["//visibility:public"], |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 420 | deps = [ |
Protobuf Team Bot | 033859f | 2022-06-24 13:52:58 -0700 | [diff] [blame^] | 421 | ":encode_internal", |
Joshua Haberman | 4b8c04e | 2020-02-18 16:50:25 -0800 | [diff] [blame] | 422 | ":port", |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 423 | ":reflection", |
Joshua Haberman | 4b8c04e | 2020-02-18 16:50:25 -0800 | [diff] [blame] | 424 | ":upb", |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 425 | ], |
| 426 | ) |
| 427 | |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 428 | # Tests ######################################################################## |
| 429 | |
| 430 | cc_test( |
| 431 | name = "test_generated_code", |
| 432 | srcs = ["upb/test_generated_code.cc"], |
| 433 | deps = [ |
| 434 | ":empty_upbdefs_proto", |
Joshua Haberman | 1cf8214 | 2022-05-12 13:57:50 -0700 | [diff] [blame] | 435 | ":port", |
Protobuf Team | bef5368 | 2022-04-04 11:18:39 -0700 | [diff] [blame] | 436 | ":test_messages_proto2_proto_upb", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 437 | ":test_messages_proto3_proto_upb", |
| 438 | ":test_upb_proto", |
Matt Kulukundis | edd1dd3 | 2022-02-20 17:44:27 -0500 | [diff] [blame] | 439 | ":upb", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 440 | "@com_google_googletest//:gtest_main", |
| 441 | ], |
| 442 | ) |
| 443 | |
| 444 | proto_library( |
| 445 | name = "test_proto", |
| 446 | testonly = 1, |
| 447 | srcs = ["upb/test.proto"], |
| 448 | ) |
| 449 | |
| 450 | upb_proto_library( |
| 451 | name = "test_upb_proto", |
| 452 | testonly = 1, |
| 453 | deps = [":test_proto"], |
| 454 | ) |
| 455 | |
| 456 | proto_library( |
| 457 | name = "empty_proto", |
| 458 | srcs = ["upb/empty.proto"], |
| 459 | ) |
| 460 | |
| 461 | upb_proto_reflection_library( |
| 462 | name = "empty_upbdefs_proto", |
| 463 | testonly = 1, |
| 464 | deps = [":empty_proto"], |
| 465 | ) |
| 466 | |
| 467 | upb_proto_library( |
Protobuf Team | bef5368 | 2022-04-04 11:18:39 -0700 | [diff] [blame] | 468 | name = "test_messages_proto2_proto_upb", |
| 469 | testonly = 1, |
| 470 | deps = ["@com_google_protobuf//:test_messages_proto2_proto"], |
| 471 | ) |
| 472 | |
| 473 | upb_proto_library( |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 474 | name = "test_messages_proto3_proto_upb", |
| 475 | testonly = 1, |
| 476 | deps = ["@com_google_protobuf//:test_messages_proto3_proto"], |
| 477 | ) |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 478 | |
Protobuf Team Bot | 6e1aa9f | 2022-06-08 11:17:20 -0700 | [diff] [blame] | 479 | proto_library( |
| 480 | name = "json_test_proto", |
| 481 | testonly = 1, |
| 482 | srcs = ["upb/json_test.proto"], |
| 483 | deps = ["@com_google_protobuf//:struct_proto"], |
| 484 | ) |
| 485 | |
| 486 | upb_proto_library( |
| 487 | name = "json_test_upb_proto", |
| 488 | testonly = 1, |
| 489 | deps = [":json_test_proto"], |
| 490 | ) |
| 491 | |
| 492 | upb_proto_reflection_library( |
| 493 | name = "json_test_upb_proto_reflection", |
| 494 | testonly = 1, |
| 495 | deps = [":json_test_proto"], |
| 496 | ) |
| 497 | |
| 498 | cc_test( |
| 499 | name = "json_test", |
| 500 | srcs = ["upb/json_test.cc"], |
| 501 | deps = [ |
| 502 | ":json", |
| 503 | ":json_test_upb_proto", |
| 504 | ":json_test_upb_proto_reflection", |
| 505 | ":reflection", |
| 506 | ":struct_upb_proto", |
| 507 | ":upb", |
| 508 | "@com_google_googletest//:gtest_main", |
| 509 | ], |
| 510 | ) |
| 511 | |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 512 | cc_test( |
| 513 | name = "msg_test", |
| 514 | srcs = ["upb/msg_test.cc"], |
| 515 | deps = [ |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 516 | ":json", |
Matt Kulukundis | a3bd5f8 | 2022-02-21 23:47:27 -0500 | [diff] [blame] | 517 | ":msg_test_upb_proto", |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 518 | ":msg_test_upb_proto_reflection", |
Matt Kulukundis | a3bd5f8 | 2022-02-21 23:47:27 -0500 | [diff] [blame] | 519 | ":reflection", |
Matt Kulukundis | 42c121e | 2022-02-21 23:58:17 -0500 | [diff] [blame] | 520 | ":test_messages_proto3_proto_upb", |
Matt Kulukundis | a3bd5f8 | 2022-02-21 23:47:27 -0500 | [diff] [blame] | 521 | ":upb", |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 522 | "@com_google_googletest//:gtest_main", |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 523 | ], |
| 524 | ) |
| 525 | |
| 526 | proto_library( |
| 527 | name = "msg_test_proto", |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 528 | testonly = 1, |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 529 | srcs = ["upb/msg_test.proto"], |
| 530 | deps = ["@com_google_protobuf//:test_messages_proto3_proto"], |
| 531 | ) |
| 532 | |
Matt Kulukundis | a3bd5f8 | 2022-02-21 23:47:27 -0500 | [diff] [blame] | 533 | upb_proto_library( |
| 534 | name = "msg_test_upb_proto", |
| 535 | testonly = 1, |
| 536 | deps = [":msg_test_proto"], |
| 537 | ) |
| 538 | |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 539 | upb_proto_reflection_library( |
| 540 | name = "msg_test_upb_proto_reflection", |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 541 | testonly = 1, |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 542 | deps = [":msg_test_proto"], |
| 543 | ) |
| 544 | |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 545 | proto_library( |
| 546 | name = "test_cpp_proto", |
| 547 | srcs = ["upb/test_cpp.proto"], |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 548 | deps = ["@com_google_protobuf//:timestamp_proto"], |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 549 | ) |
| 550 | |
| 551 | upb_proto_library( |
| 552 | name = "test_cpp_upb_proto", |
| 553 | deps = ["test_cpp_proto"], |
| 554 | ) |
| 555 | |
| 556 | upb_proto_reflection_library( |
| 557 | name = "test_cpp_upb_proto_reflection", |
| 558 | deps = ["test_cpp_proto"], |
| 559 | ) |
| 560 | |
Matt Kulukundis | 92d71a4 | 2022-02-20 15:20:48 -0500 | [diff] [blame] | 561 | upb_proto_library( |
Protobuf Team Bot | 6e1aa9f | 2022-06-08 11:17:20 -0700 | [diff] [blame] | 562 | name = "struct_upb_proto", |
| 563 | deps = ["@com_google_protobuf//:struct_proto"], |
| 564 | ) |
| 565 | |
| 566 | upb_proto_library( |
Matt Kulukundis | 92d71a4 | 2022-02-20 15:20:48 -0500 | [diff] [blame] | 567 | name = "timestamp_upb_proto", |
| 568 | deps = ["@com_google_protobuf//:timestamp_proto"], |
| 569 | ) |
| 570 | |
| 571 | upb_proto_reflection_library( |
| 572 | name = "timestamp_upb_proto_reflection", |
| 573 | deps = ["@com_google_protobuf//:timestamp_proto"], |
| 574 | ) |
| 575 | |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 576 | cc_test( |
| 577 | name = "test_cpp", |
| 578 | srcs = ["upb/test_cpp.cc"], |
| 579 | copts = UPB_DEFAULT_CPPOPTS, |
| 580 | deps = [ |
| 581 | ":test_cpp_upb_proto", |
| 582 | ":test_cpp_upb_proto_reflection", |
Matt Kulukundis | 92d71a4 | 2022-02-20 15:20:48 -0500 | [diff] [blame] | 583 | ":timestamp_upb_proto", |
| 584 | ":timestamp_upb_proto_reflection", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 585 | "//:json", |
| 586 | "//:port", |
| 587 | "//:reflection", |
| 588 | "//:upb", |
| 589 | "@com_google_googletest//:gtest_main", |
| 590 | ], |
| 591 | ) |
| 592 | |
| 593 | cc_test( |
| 594 | name = "test_table", |
| 595 | srcs = ["upb/test_table.cc"], |
| 596 | copts = UPB_DEFAULT_CPPOPTS, |
| 597 | deps = [ |
| 598 | "//:port", |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 599 | "//:table_internal", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 600 | "//:upb", |
| 601 | "@com_google_googletest//:gtest_main", |
| 602 | ], |
| 603 | ) |
| 604 | |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 605 | upb_proto_library( |
| 606 | name = "conformance_proto_upb", |
| 607 | testonly = 1, |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 608 | deps = ["@com_google_protobuf//conformance:conformance_proto"], |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 609 | ) |
| 610 | |
| 611 | upb_proto_reflection_library( |
| 612 | name = "conformance_proto_upbdefs", |
| 613 | testonly = 1, |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 614 | deps = ["@com_google_protobuf//conformance:conformance_proto"], |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 615 | ) |
| 616 | |
| 617 | upb_proto_reflection_library( |
| 618 | name = "test_messages_proto2_upbdefs", |
| 619 | testonly = 1, |
| 620 | deps = ["@com_google_protobuf//:test_messages_proto2_proto"], |
| 621 | ) |
| 622 | |
| 623 | upb_proto_reflection_library( |
| 624 | name = "test_messages_proto3_upbdefs", |
| 625 | testonly = 1, |
| 626 | deps = ["@com_google_protobuf//:test_messages_proto3_proto"], |
| 627 | ) |
| 628 | |
| 629 | cc_binary( |
| 630 | name = "conformance_upb", |
| 631 | testonly = 1, |
| 632 | srcs = ["upb/conformance_upb.c"], |
| 633 | copts = UPB_DEFAULT_COPTS, |
| 634 | data = ["upb/conformance_upb_failures.txt"], |
| 635 | deps = [ |
| 636 | ":conformance_proto_upb", |
| 637 | ":conformance_proto_upbdefs", |
| 638 | ":test_messages_proto2_upbdefs", |
| 639 | ":test_messages_proto3_upbdefs", |
| 640 | "//:json", |
| 641 | "//:port", |
| 642 | "//:reflection", |
| 643 | "//:textformat", |
| 644 | "//:upb", |
| 645 | ], |
| 646 | ) |
| 647 | |
| 648 | make_shell_script( |
| 649 | name = "gen_test_conformance_upb", |
| 650 | out = "test_conformance_upb.sh", |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 651 | contents = "external/com_google_protobuf/conformance/conformance_test_runner " + |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 652 | " --enforce_recommended " + |
| 653 | " --failure_list ./upb/conformance_upb_failures.txt" + |
| 654 | " ./conformance_upb", |
| 655 | ) |
| 656 | |
| 657 | sh_test( |
| 658 | name = "test_conformance_upb", |
| 659 | srcs = ["test_conformance_upb.sh"], |
| 660 | data = [ |
| 661 | "upb/conformance_upb_failures.txt", |
| 662 | ":conformance_upb", |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 663 | "@com_google_protobuf//conformance:conformance_test_runner", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 664 | ], |
| 665 | deps = ["@bazel_tools//tools/bash/runfiles"], |
| 666 | ) |
| 667 | |
Joshua Haberman | 50c1298 | 2022-03-08 15:52:37 -0800 | [diff] [blame] | 668 | cc_binary( |
| 669 | name = "conformance_upb_dynamic_minitable", |
| 670 | testonly = 1, |
| 671 | srcs = ["upb/conformance_upb.c"], |
| 672 | copts = UPB_DEFAULT_COPTS + [ |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 673 | "-DREBUILD_MINITABLES", |
Joshua Haberman | 50c1298 | 2022-03-08 15:52:37 -0800 | [diff] [blame] | 674 | ], |
| 675 | data = ["upb/conformance_upb_failures.txt"], |
| 676 | deps = [ |
| 677 | ":conformance_proto_upb", |
| 678 | ":conformance_proto_upbdefs", |
| 679 | ":test_messages_proto2_upbdefs", |
| 680 | ":test_messages_proto3_upbdefs", |
| 681 | "//:json", |
| 682 | "//:port", |
| 683 | "//:reflection", |
| 684 | "//:textformat", |
| 685 | "//:upb", |
| 686 | ], |
| 687 | ) |
| 688 | |
| 689 | make_shell_script( |
| 690 | name = "gen_test_conformance_upb_dynamic_minitable", |
| 691 | out = "test_conformance_upb_dynamic_minitable.sh", |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 692 | contents = "external/com_google_protobuf/conformance/conformance_test_runner " + |
Joshua Haberman | 50c1298 | 2022-03-08 15:52:37 -0800 | [diff] [blame] | 693 | " --enforce_recommended " + |
| 694 | " --failure_list ./upb/conformance_upb_failures.txt" + |
| 695 | " ./conformance_upb_dynamic_minitable", |
| 696 | ) |
| 697 | |
| 698 | sh_test( |
| 699 | name = "test_conformance_upb_dynamic_minitable", |
| 700 | srcs = ["test_conformance_upb_dynamic_minitable.sh"], |
| 701 | data = [ |
| 702 | "upb/conformance_upb_failures.txt", |
| 703 | ":conformance_upb_dynamic_minitable", |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 704 | "@com_google_protobuf//conformance:conformance_test_runner", |
Joshua Haberman | 50c1298 | 2022-03-08 15:52:37 -0800 | [diff] [blame] | 705 | ], |
| 706 | deps = ["@bazel_tools//tools/bash/runfiles"], |
| 707 | ) |
| 708 | |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 709 | # Internal C/C++ libraries ##################################################### |
| 710 | |
| 711 | cc_library( |
Protobuf Team Bot | 8d0d13f | 2022-06-23 13:43:40 -0700 | [diff] [blame] | 712 | name = "arena_internal", |
| 713 | srcs = [ |
| 714 | "upb/alloc.h", |
| 715 | "upb/arena.h", |
| 716 | ], |
| 717 | hdrs = ["upb/internal/arena.h"], |
| 718 | copts = UPB_DEFAULT_COPTS, |
| 719 | visibility = ["//:__subpackages__"], |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 720 | deps = [":port"], |
Protobuf Team Bot | 8d0d13f | 2022-06-23 13:43:40 -0700 | [diff] [blame] | 721 | ) |
| 722 | |
| 723 | cc_library( |
Protobuf Team Bot | 033859f | 2022-06-24 13:52:58 -0700 | [diff] [blame^] | 724 | name = "encode_internal", |
| 725 | hdrs = ["upb/internal/encode.h"], |
| 726 | copts = UPB_DEFAULT_COPTS, |
| 727 | visibility = ["//:__subpackages__"], |
| 728 | deps = [":port"], |
| 729 | ) |
| 730 | |
| 731 | cc_library( |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 732 | name = "table_internal", |
| 733 | srcs = [ |
| 734 | "upb/internal/table.c", |
| 735 | ], |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 736 | hdrs = [ |
Protobuf Team Bot | 7b05f25 | 2022-06-22 09:18:12 -0700 | [diff] [blame] | 737 | "upb/alloc.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 738 | "upb/arena.h", |
| 739 | "upb/internal/table.h", |
| 740 | "upb/status.h", |
Protobuf Team Bot | e153b52 | 2022-06-23 14:12:45 -0700 | [diff] [blame] | 741 | "upb/string_view.h", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 742 | "upb/upb.h", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 743 | ], |
Protobuf Team Bot | 15596be | 2022-06-24 10:38:27 -0700 | [diff] [blame] | 744 | copts = UPB_DEFAULT_COPTS, |
| 745 | visibility = ["//:__subpackages__"], |
| 746 | deps = [":port"], |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 747 | ) |
| 748 | |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 749 | # Amalgamation ################################################################# |
| 750 | |
Protobuf Team | b8edc71 | 2022-03-16 08:24:52 -0700 | [diff] [blame] | 751 | # begin:github_only |
Joshua Haberman | 83c0edb | 2021-02-28 16:56:49 -0800 | [diff] [blame] | 752 | |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 753 | upb_amalgamation( |
| 754 | name = "gen_amalgamation", |
| 755 | outs = [ |
| 756 | "upb.c", |
| 757 | "upb.h", |
| 758 | ], |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 759 | libs = [ |
Protobuf Team Bot | 8d0d13f | 2022-06-23 13:43:40 -0700 | [diff] [blame] | 760 | ":arena_internal", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 761 | ":collections", |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 762 | ":descriptor_upb_proto", |
Protobuf Team Bot | 033859f | 2022-06-24 13:52:58 -0700 | [diff] [blame^] | 763 | ":encode_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 764 | ":extension_registry", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 765 | ":fastdecode", |
| 766 | ":mini_table", |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 767 | ":port", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 768 | ":reflection", |
| 769 | ":upb", |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 770 | ], |
| 771 | ) |
| 772 | |
| 773 | cc_library( |
| 774 | name = "amalgamation", |
| 775 | srcs = ["upb.c"], |
| 776 | hdrs = ["upb.h"], |
Joshua Haberman | e86541a | 2020-10-28 17:53:09 -0700 | [diff] [blame] | 777 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 778 | deps = ["//third_party/utf8_range"], |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 779 | ) |
| 780 | |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 781 | upb_amalgamation( |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 782 | name = "gen_php_amalgamation", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 783 | outs = [ |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 784 | "php-upb.c", |
| 785 | "php-upb.h", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 786 | ], |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 787 | libs = [ |
Protobuf Team Bot | 8d0d13f | 2022-06-23 13:43:40 -0700 | [diff] [blame] | 788 | ":arena_internal", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 789 | ":collections", |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 790 | ":descriptor_upb_proto", |
| 791 | ":descriptor_upb_proto_reflection", |
Protobuf Team Bot | 033859f | 2022-06-24 13:52:58 -0700 | [diff] [blame^] | 792 | ":encode_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 793 | ":extension_registry", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 794 | ":fastdecode", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 795 | ":json", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 796 | ":mini_table", |
| 797 | ":port", |
| 798 | ":reflection", |
| 799 | ":upb", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 800 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 801 | prefix = "php-", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 802 | ) |
| 803 | |
| 804 | cc_library( |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 805 | name = "php_amalgamation", |
| 806 | srcs = ["php-upb.c"], |
| 807 | hdrs = ["php-upb.h"], |
Joshua Haberman | e86541a | 2020-10-28 17:53:09 -0700 | [diff] [blame] | 808 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 809 | deps = ["//third_party/utf8_range"], |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 810 | ) |
| 811 | |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 812 | upb_amalgamation( |
| 813 | name = "gen_ruby_amalgamation", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 814 | outs = [ |
| 815 | "ruby-upb.c", |
| 816 | "ruby-upb.h", |
| 817 | ], |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 818 | libs = [ |
Protobuf Team Bot | 8d0d13f | 2022-06-23 13:43:40 -0700 | [diff] [blame] | 819 | ":arena_internal", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 820 | ":collections", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 821 | ":descriptor_upb_proto", |
Protobuf Team Bot | 033859f | 2022-06-24 13:52:58 -0700 | [diff] [blame^] | 822 | ":encode_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame] | 823 | ":extension_registry", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 824 | ":fastdecode", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 825 | ":json", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 826 | ":mini_table", |
| 827 | ":port", |
| 828 | ":reflection", |
| 829 | ":upb", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 830 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 831 | prefix = "ruby-", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 832 | ) |
| 833 | |
| 834 | cc_library( |
| 835 | name = "ruby_amalgamation", |
| 836 | srcs = ["ruby-upb.c"], |
| 837 | hdrs = ["ruby-upb.h"], |
Joshua Haberman | e86541a | 2020-10-28 17:53:09 -0700 | [diff] [blame] | 838 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 839 | deps = ["//third_party/utf8_range"], |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 840 | ) |
| 841 | |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 842 | exports_files( |
| 843 | [ |
Joshua Haberman | bfc86d3 | 2019-12-04 16:56:40 -0800 | [diff] [blame] | 844 | "third_party/lunit/console.lua", |
| 845 | "third_party/lunit/lunit.lua", |
| 846 | ], |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 847 | visibility = ["//upb/bindings/lua:__pkg__"], |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 848 | ) |
| 849 | |
Joshua Haberman | 985145c | 2019-04-24 17:36:17 +0000 | [diff] [blame] | 850 | filegroup( |
| 851 | name = "cmake_files", |
| 852 | srcs = glob([ |
Joshua Haberman | 985145c | 2019-04-24 17:36:17 +0000 | [diff] [blame] | 853 | "upbc/**/*", |
| 854 | "upb/**/*", |
Joshua Haberman | 4f901b6 | 2020-10-14 16:32:43 -0700 | [diff] [blame] | 855 | "third_party/**/*", |
Joshua Haberman | 9a66356 | 2019-05-13 16:13:39 -0700 | [diff] [blame] | 856 | ]), |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 857 | visibility = ["//cmake:__pkg__"], |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 858 | ) |
Joshua Haberman | 83c0edb | 2021-02-28 16:56:49 -0800 | [diff] [blame] | 859 | |
Protobuf Team | b8edc71 | 2022-03-16 08:24:52 -0700 | [diff] [blame] | 860 | # end:github_only |
Joshua Haberman | 4ffeaa6 | 2022-06-01 12:25:11 -0700 | [diff] [blame] | 861 | |
| 862 | # begin:google_only |
| 863 | # |
| 864 | # py_binary( |
| 865 | # name = "update_check_runs", |
| 866 | # srcs = ["update_check_runs.py"], |
| 867 | # main = "update_check_runs.py", |
| 868 | # deps = [ |
| 869 | # "//third_party/py/absl:app", |
| 870 | # ], |
| 871 | # ) |
| 872 | # |
| 873 | # end:google_only |