2 "//bazel:build_defs.bzl",
4 "upb_amalgamation", # copybara:strip_for_google3
7 "//bazel:upb_proto_library.bzl",
8 "upb_fasttable_enabled",
10 "upb_proto_library_copts",
11 "upb_proto_reflection_library",
14 # copybara:strip_for_google3_begin
16 "@rules_proto//proto:defs.bzl",
22 licenses(["notice"]) # BSD (Google-authored w/ possible external contributions)
31 constraint_values = ["@bazel_tools//platforms:windows"],
34 upb_fasttable_enabled(
35 name = "fasttable_enabled",
36 build_setting_default = False,
37 visibility = ["//visibility:public"],
41 name = "fasttable_enabled_setting",
42 flag_values = {"//:fasttable_enabled": "true"},
45 upb_proto_library_copts(
46 name = "upb_proto_library_copts__for_generated_code_only_do_not_use",
47 copts = UPB_DEFAULT_COPTS,
48 visibility = ["//visibility:public"],
51 # Public C/C++ libraries #######################################################
55 copts = UPB_DEFAULT_COPTS,
60 visibility = ["//tests:__pkg__"],
82 copts = UPB_DEFAULT_COPTS,
83 visibility = ["//visibility:public"],
87 "//third_party/wyhash",
100 copts = UPB_DEFAULT_COPTS,
107 # Common support routines used by generated code. This library has no
108 # implementation, but depends on :upb and exposes a few more hdrs.
110 # This is public only because we have no way of visibility-limiting it to
111 # upb_proto_library() only. This interface is not stable and by using it you
112 # give up any backward compatibility guarantees.
114 name = "generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
119 "upb/port_undef.inc",
121 copts = UPB_DEFAULT_COPTS,
122 visibility = ["//visibility:public"],
130 name = "descriptor_upb_proto",
131 visibility = ["//visibility:public"],
132 deps = ["@com_google_protobuf//:descriptor_proto"],
135 upb_proto_reflection_library(
136 name = "descriptor_upb_proto_reflection",
137 visibility = ["//visibility:public"],
138 deps = ["@com_google_protobuf//:descriptor_proto"],
153 copts = UPB_DEFAULT_COPTS,
154 visibility = ["//visibility:public"],
156 ":descriptor_upb_proto",
171 copts = UPB_DEFAULT_COPTS,
172 visibility = ["//visibility:public"],
189 copts = UPB_DEFAULT_COPTS,
190 visibility = ["//visibility:public"],
198 # Internal C/C++ libraries #####################################################
206 visibility = ["//tests:__pkg__"],
212 # Legacy C/C++ Libraries (not recommended for new code) ########################
218 "upb/handlers-inl.h",
225 copts = UPB_DEFAULT_COPTS,
226 visibility = ["//tests:__pkg__"],
238 "upb/pb/compile_decoder.c",
240 "upb/pb/decoder.int.h",
242 "upb/pb/textprinter.c",
244 "upb/pb/varint.int.h",
249 "upb/pb/textprinter.h",
251 copts = UPB_DEFAULT_COPTS,
252 visibility = ["//tests:__pkg__"],
254 ":descriptor_upb_proto",
263 # copybara:strip_for_google3_begin
268 "upb/json/printer.c",
272 "upb/json/printer.h",
274 copts = UPB_DEFAULT_COPTS,
275 visibility = ["//tests:__pkg__"],
283 name = "generate_json_ragel",
284 srcs = ["//:upb/json/parser.rl"],
285 outs = ["upb/json/parser.c"],
286 cmd = "$(location @ragel//:ragelc) -C -o upb/json/parser.c $< && mv upb/json/parser.c $@",
287 tools = ["@ragel//:ragelc"],
288 visibility = ["//cmake:__pkg__"],
291 # Amalgamation #################################################################
295 srcs = ["tools/amalgamate.py"],
299 name = "gen_amalgamation",
304 amalgamator = ":amalgamate",
308 ":descriptor_upb_proto",
318 name = "amalgamation",
321 copts = UPB_DEFAULT_COPTS,
322 deps = ["//third_party/wyhash"],
326 name = "gen_php_amalgamation",
331 amalgamator = ":amalgamate",
335 ":descriptor_upb_proto",
336 ":descriptor_upb_proto_reflection",
345 name = "php_amalgamation",
346 srcs = ["php-upb.c"],
347 hdrs = ["php-upb.h"],
348 copts = UPB_DEFAULT_COPTS,
349 deps = ["//third_party/wyhash"],
353 name = "gen_ruby_amalgamation",
358 amalgamator = ":amalgamate",
362 ":descriptor_upb_proto",
371 name = "ruby_amalgamation",
372 srcs = ["ruby-upb.c"],
373 hdrs = ["ruby-upb.h"],
374 copts = UPB_DEFAULT_COPTS,
375 deps = ["//third_party/wyhash"],
380 "upb/json/parser.rl",
384 visibility = ["//cmake:__pkg__"],
389 "third_party/lunit/console.lua",
390 "third_party/lunit/lunit.lua",
392 visibility = ["//tests/bindings/lua:__pkg__"],
396 name = "cmake_files",
400 "generated_for_cmake/**/*",
407 visibility = ["//cmake:__pkg__"],