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