Changed generated code deps to avoid deps on core libraries.

This will allow the core libraries to be visibility controlled if
necessary.
pull/13171/head
Joshua Haberman 3 years ago
parent 92d08f8842
commit 8c530f9226
  1. 18
      BUILD
  2. 5
      bazel/upb_proto_library.bzl
  3. 5
      cmake/CMakeLists.txt

18
BUILD

@ -137,7 +137,9 @@ cc_library(
cc_library(
name = "generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
hdrs = [
"upb/decode.h",
"upb/decode_fast.h",
"upb/encode.h",
"upb/msg.h",
"upb/msg_internal.h",
"upb/port_def.inc",
@ -151,6 +153,22 @@ cc_library(
],
)
cc_library(
name = "generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
hdrs = [
"upb/def.h",
"upb/port_def.inc",
"upb/port_undef.inc",
],
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
":descriptor_upb_proto",
":reflection",
":table",
],
)
upb_proto_library(
name = "descriptor_upb_proto",
visibility = ["//visibility:public"],

@ -299,7 +299,6 @@ _upb_proto_library_aspect = aspect(
),
"_upb": attr.label_list(default = [
"//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
"//:upb",
]),
"_fasttable_enabled": attr.label(default = "//:fasttable_enabled"),
}),
@ -348,9 +347,7 @@ _upb_proto_reflection_library_aspect = aspect(
),
"_upbdefs": attr.label_list(
default = [
"//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
"//:upb",
"//:reflection",
"//:generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
],
),
}),

@ -97,6 +97,11 @@ add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_p
target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE
table
upb)
add_library(generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE)
target_link_libraries(generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE
descriptor_upb_proto
reflection
table)
add_library(reflection
../upb/def.c
../upb/msg.h

Loading…
Cancel
Save