More Blaze fixes.

pull/13171/head
Joshua Haberman 6 years ago
parent 13eb14986b
commit 9a66356d95
  1. 41
      BUILD
  2. 1
      CMakeLists.txt

41
BUILD

@ -60,12 +60,12 @@ cc_library(
"upb/msg.h", "upb/msg.h",
"upb/upb.h", "upb/upb.h",
], ],
copts = COPTS,
# Internal-only, but we have to make them public for generated code. # Internal-only, but we have to make them public for generated code.
textual_hdrs = [ textual_hdrs = [
"upb/port_def.inc", "upb/port_def.inc",
"upb/port_undef.inc", "upb/port_undef.inc",
], ],
copts = COPTS,
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
@ -88,7 +88,7 @@ cc_library(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
":descriptor_upbproto", ":descriptor_upbproto",
":upb" ":upb",
], ],
) )
@ -108,8 +108,11 @@ cc_library(
"upb/legacy_msg_reflection.c", "upb/legacy_msg_reflection.c",
], ],
hdrs = ["upb/legacy_msg_reflection.h"], hdrs = ["upb/legacy_msg_reflection.h"],
deps = [":upb"],
copts = COPTS, copts = COPTS,
deps = [
":table",
":upb",
],
) )
cc_library( cc_library(
@ -154,6 +157,7 @@ cc_library(
], ],
) )
# copybara:strip_for_google3_begin
cc_library( cc_library(
name = "upb_json", name = "upb_json",
srcs = [ srcs = [
@ -170,6 +174,7 @@ cc_library(
":upb_pb", ":upb_pb",
], ],
) )
# copybara:strip_end
cc_library( cc_library(
name = "upb_cc_bindings", name = "upb_cc_bindings",
@ -189,31 +194,29 @@ cc_library(
"upbc/message_layout.h", "upbc/message_layout.h",
], ],
hdrs = ["upbc/generator.h"], hdrs = ["upbc/generator.h"],
copts = CPPOPTS,
deps = [ deps = [
map_dep("@absl//absl/base:core_headers"), map_dep("@absl//absl/base:core_headers"),
map_dep("@absl//absl/strings"), map_dep("@absl//absl/strings"),
map_dep("@com_google_protobuf//:protobuf"), map_dep("@com_google_protobuf//:protobuf"),
map_dep("@com_google_protobuf//:protoc_lib"), map_dep("@com_google_protobuf//:protoc_lib"),
], ],
copts = CPPOPTS,
) )
cc_binary( cc_binary(
name = "protoc-gen-upb", name = "protoc-gen-upb",
srcs = ["upbc/main.cc"], srcs = ["upbc/main.cc"],
copts = CPPOPTS,
visibility = ["//visibility:public"],
deps = [ deps = [
":upbc_generator", ":upbc_generator",
map_dep("@com_google_protobuf//:protoc_lib"), map_dep("@com_google_protobuf//:protoc_lib"),
], ],
copts = CPPOPTS,
visibility = ["//visibility:public"],
) )
# We strip the tests and remaining rules from google3 until the upb_proto_library() # We strip the tests and remaining rules from google3 until the upb_proto_library()
# and upb_proto_reflection_library() rules are fixed. # and upb_proto_reflection_library() rules are fixed.
# copybara:strip_for_google3_begin
# C/C++ tests ################################################################## # C/C++ tests ##################################################################
cc_library( cc_library(
@ -232,11 +235,11 @@ cc_library(
cc_test( cc_test(
name = "test_varint", name = "test_varint",
srcs = ["tests/pb/test_varint.c"], srcs = ["tests/pb/test_varint.c"],
copts = COPTS,
deps = [ deps = [
":upb_pb", ":upb_pb",
":upb_test", ":upb_test",
], ],
copts = COPTS,
) )
proto_library( proto_library(
@ -254,12 +257,12 @@ upb_proto_reflection_library(
cc_test( cc_test(
name = "test_decoder", name = "test_decoder",
srcs = ["tests/pb/test_decoder.cc"], srcs = ["tests/pb/test_decoder.cc"],
copts = CPPOPTS,
deps = [ deps = [
":test_decoder_upbproto", ":test_decoder_upbproto",
":upb_pb", ":upb_pb",
":upb_test", ":upb_test",
], ],
copts = CPPOPTS,
) )
upb_proto_reflection_library( upb_proto_reflection_library(
@ -270,13 +273,13 @@ upb_proto_reflection_library(
cc_test( cc_test(
name = "test_encoder", name = "test_encoder",
srcs = ["tests/pb/test_encoder.cc"], srcs = ["tests/pb/test_encoder.cc"],
copts = CPPOPTS,
deps = [ deps = [
"descriptor_upbreflection", "descriptor_upbreflection",
":upb_cc_bindings", ":upb_cc_bindings",
":upb_pb", ":upb_pb",
":upb_test", ":upb_test",
], ],
copts = CPPOPTS,
) )
proto_library( proto_library(
@ -294,25 +297,26 @@ upb_proto_reflection_library(
cc_test( cc_test(
name = "test_cpp", name = "test_cpp",
srcs = ["tests/test_cpp.cc"], srcs = ["tests/test_cpp.cc"],
copts = CPPOPTS,
deps = [ deps = [
":test_cpp_upbproto", ":test_cpp_upbproto",
":upb", ":upb",
":upb_pb", ":upb_pb",
":upb_test", ":upb_test",
], ],
copts = CPPOPTS,
) )
cc_test( cc_test(
name = "test_table", name = "test_table",
srcs = ["tests/test_table.cc"], srcs = ["tests/test_table.cc"],
copts = CPPOPTS,
deps = [ deps = [
":upb", ":upb",
":upb_test", ":upb_test",
], ],
copts = CPPOPTS,
) )
# copybara:strip_for_google3_begin
proto_library( proto_library(
name = "test_json_enum_from_separate", name = "test_json_enum_from_separate",
srcs = ["tests/json/enum_from_separate_file.proto"], srcs = ["tests/json/enum_from_separate_file.proto"],
@ -344,14 +348,15 @@ cc_test(
srcs = [ srcs = [
"tests/json/test_json.cc", "tests/json/test_json.cc",
], ],
copts = CPPOPTS,
deps = [ deps = [
":test_json_upbprotoreflection",
":test_json_upbproto", ":test_json_upbproto",
":test_json_upbprotoreflection",
":upb_json", ":upb_json",
":upb_test", ":upb_test",
], ],
copts = CPPOPTS,
) )
# copybara:strip_end
upb_proto_library( upb_proto_library(
name = "conformance_proto_upb", name = "conformance_proto_upb",
@ -393,6 +398,8 @@ sh_test(
], ],
) )
# copybara:strip_for_google3_begin
# Amalgamation ################################################################# # Amalgamation #################################################################
py_binary( py_binary(
@ -497,7 +504,7 @@ filegroup(
"upbc/**/*", "upbc/**/*",
"upb/**/*", "upb/**/*",
"tests/**/*", "tests/**/*",
]) ]),
) )
make_shell_script( make_shell_script(
@ -571,9 +578,9 @@ generated_file_staleness_test(
name = "test_generated_files", name = "test_generated_files",
outs = [ outs = [
"CMakeLists.txt", "CMakeLists.txt",
"generated_for_cmake/upb/json/parser.c",
"generated_for_cmake/google/protobuf/descriptor.upb.c", "generated_for_cmake/google/protobuf/descriptor.upb.c",
"generated_for_cmake/google/protobuf/descriptor.upb.h", "generated_for_cmake/google/protobuf/descriptor.upb.h",
"generated_for_cmake/upb/json/parser.c",
], ],
generated_pattern = "generated-in/%s", generated_pattern = "generated-in/%s",
) )

@ -87,6 +87,7 @@ add_library(legacy_msg_reflection
upb/legacy_msg_reflection.c upb/legacy_msg_reflection.c
upb/legacy_msg_reflection.h) upb/legacy_msg_reflection.h)
target_link_libraries(legacy_msg_reflection target_link_libraries(legacy_msg_reflection
table
upb) upb)
add_library(handlers add_library(handlers
upb/handlers.c upb/handlers.c

Loading…
Cancel
Save