From 77371f050c317d01c5c089eb057b24d439f40dd3 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 23 Jan 2019 16:26:13 -0800 Subject: Some rearranging and cleanup. --- BUILD | 103 ++++++++++++++++++++++++++++++------------------------------------ 1 file changed, 46 insertions(+), 57 deletions(-) (limited to 'BUILD') diff --git a/BUILD b/BUILD index 80daf4f..0a8a684 100644 --- a/BUILD +++ b/BUILD @@ -11,11 +11,6 @@ load( "upb_proto_reflection_library", ) -config_setting( - name = "k8", - values = {"cpu": "k8"}, -) - # C/C++ rules ################################################################## cc_library( @@ -112,31 +107,30 @@ cc_library( deps = [":upb"], ) -# Amalgamation ################################################################# - -py_binary( - name = "amalgamate", - srcs = ["tools/amalgamate.py"], -) +# upb compiler ################################################################# -upb_amalgamation( - name = "gen_amalgamation", - outs = [ - "upb.c", - "upb.h", +cc_library( + name = "upbc_generator", + srcs = [ + "upbc/generator.cc", + "upbc/message_layout.cc", + "upbc/message_layout.h", ], - amalgamator = ":amalgamate", - libs = [ - ":upb", - ":upb_pb", - ":upb_json", + hdrs = ["upbc/generator.h"], + deps = [ + "@absl//absl/strings", + "@com_google_protobuf//:protobuf", + "@com_google_protobuf//:protoc_lib", ], ) -cc_library( - name = "amalgamation", - srcs = ["upb.c"], - hdrs = ["upb.h"], +cc_binary( + name = "protoc-gen-upb", + srcs = ["upbc/main.cc"], + deps = [ + ":upbc_generator", + "@com_google_protobuf//:protoc_lib", + ], ) # C/C++ tests ################################################################## @@ -162,12 +156,6 @@ cc_test( ], ) -upb_proto_reflection_library( - name = "descriptor_upbproto", - upbc = ":protoc-gen-upb", - deps = ["descriptor_proto"], -) - proto_library( name = "test_decoder_proto", srcs = [ @@ -296,6 +284,33 @@ sh_test( ], ) +# Amalgamation ################################################################# + +py_binary( + name = "amalgamate", + srcs = ["tools/amalgamate.py"], +) + +upb_amalgamation( + name = "gen_amalgamation", + outs = [ + "upb.c", + "upb.h", + ], + amalgamator = ":amalgamate", + libs = [ + ":upb", + ":upb_pb", + ":upb_json", + ], +) + +cc_library( + name = "amalgamation", + srcs = ["upb.c"], + hdrs = ["upb.h"], +) + # Lua libraries. ############################################################### lua_cclibrary( @@ -352,32 +367,6 @@ lua_test( luamain = "tests/bindings/lua/test_upb.pb.lua", ) -# upb compiler ################################################################# - -cc_library( - name = "upbc_generator", - srcs = [ - "upbc/generator.cc", - "upbc/message_layout.cc", - "upbc/message_layout.h", - ], - hdrs = ["upbc/generator.h"], - deps = [ - "@absl//absl/strings", - "@com_google_protobuf//:protobuf", - "@com_google_protobuf//:protoc_lib", - ], -) - -cc_binary( - name = "protoc-gen-upb", - srcs = ["upbc/main.cc"], - deps = [ - ":upbc_generator", - "@com_google_protobuf//:protoc_lib", - ], -) - # Test the CMake build ######################################################### make_shell_script( -- cgit v1.2.3