Added a BUILD file for wyhash.

This will make the build more closely resemble the google3
build.

The CMake output from this is a bit busted, but the build
does succeed.
pull/13171/head
Joshua Haberman 5 years ago
parent a5b5445da6
commit e9b79542ad
  1. 25
      BUILD
  2. 2
      cmake/BUILD
  3. 5
      cmake/CMakeLists.txt
  4. 1
      cmake/make_cmakelists.py
  5. 18
      third_party/wyhash/BUILD

25
BUILD

@ -65,7 +65,6 @@ cc_library(
"upb/table.int.h", "upb/table.int.h",
"upb/upb.c", "upb/upb.c",
"upb/upb.int.h", "upb/upb.int.h",
"third_party/wyhash/wyhash.h",
], ],
hdrs = [ hdrs = [
"upb/decode.h", "upb/decode.h",
@ -75,7 +74,10 @@ cc_library(
], ],
copts = UPB_DEFAULT_COPTS, copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [":port"], deps = [
":port",
"//third_party/wyhash",
],
) )
# Common support routines used by generated code. This library has no # Common support routines used by generated code. This library has no
@ -286,12 +288,10 @@ upb_amalgamation(
cc_library( cc_library(
name = "amalgamation", name = "amalgamation",
srcs = [ srcs = ["upb.c"],
"upb.c",
"third_party/wyhash/wyhash.h",
],
hdrs = ["upb.h"], hdrs = ["upb.h"],
copts = UPB_DEFAULT_COPTS, copts = UPB_DEFAULT_COPTS,
deps = ["//third_party/wyhash"],
) )
upb_amalgamation( upb_amalgamation(
@ -314,13 +314,10 @@ upb_amalgamation(
cc_library( cc_library(
name = "php_amalgamation", name = "php_amalgamation",
srcs = [ srcs = ["php-upb.c"],
"php-upb.c",
"third_party/wyhash/wyhash.h",
],
hdrs = ["php-upb.h"], hdrs = ["php-upb.h"],
copts = UPB_DEFAULT_COPTS, copts = UPB_DEFAULT_COPTS,
deps = ["//third_party/wyhash"],
) )
upb_amalgamation( upb_amalgamation(
@ -342,12 +339,10 @@ upb_amalgamation(
cc_library( cc_library(
name = "ruby_amalgamation", name = "ruby_amalgamation",
srcs = [ srcs = ["ruby-upb.c"],
"ruby-upb.c",
"third_party/wyhash/wyhash.h",
],
hdrs = ["ruby-upb.h"], hdrs = ["ruby-upb.h"],
copts = UPB_DEFAULT_COPTS, copts = UPB_DEFAULT_COPTS,
deps = ["//third_party/wyhash"],
) )
exports_files( exports_files(

@ -28,6 +28,7 @@ genrule(
"//:BUILD", "//:BUILD",
"//:WORKSPACE", "//:WORKSPACE",
"//:cmake_files", "//:cmake_files",
"//third_party/wyhash:cmake_files",
":cmake_files", ":cmake_files",
], ],
outs = ["generated-in/CMakeLists.txt"], outs = ["generated-in/CMakeLists.txt"],
@ -84,6 +85,7 @@ sh_test(
data = [ data = [
":cmake_files", ":cmake_files",
"//:cmake_files", "//:cmake_files",
"//third_party/wyhash:cmake_files",
], ],
deps = ["@bazel_tools//tools/bash/runfiles"], deps = ["@bazel_tools//tools/bash/runfiles"],
) )

@ -71,13 +71,13 @@ add_library(upb
../upb/table.int.h ../upb/table.int.h
../upb/upb.c ../upb/upb.c
../upb/upb.int.h ../upb/upb.int.h
../third_party/wyhash/wyhash.h
../upb/decode.h ../upb/decode.h
../upb/encode.h ../upb/encode.h
../upb/upb.h ../upb/upb.h
../upb/upb.hpp) ../upb/upb.hpp)
target_link_libraries(upb target_link_libraries(upb
port) port
/third_party/wyhash)
add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE) add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE)
target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE
table table
@ -150,5 +150,6 @@ add_library(upb_json
target_link_libraries(upb_json target_link_libraries(upb_json
upb upb
upb_pb) upb_pb)
add_library(wyhash INTERFACE)

@ -280,6 +280,7 @@ globs = GetDict(converter)
exec(open("WORKSPACE").read(), GetDict(WorkspaceFileFunctions(converter))) exec(open("WORKSPACE").read(), GetDict(WorkspaceFileFunctions(converter)))
exec(open("BUILD").read(), GetDict(BuildFileFunctions(converter))) exec(open("BUILD").read(), GetDict(BuildFileFunctions(converter)))
exec(open("third_party/wyhash/BUILD").read(), GetDict(BuildFileFunctions(converter)))
with open(sys.argv[1], "w") as f: with open(sys.argv[1], "w") as f:
f.write(converter.convert()) f.write(converter.convert())

@ -0,0 +1,18 @@
licenses(["unencumbered"])
exports_files(["LICENSE"])
cc_library(
name = "wyhash",
hdrs = ["wyhash.h"],
visibility = ["//:__pkg__"],
)
filegroup(
name = "cmake_files",
srcs = glob([
"**/*",
]),
visibility = ["//cmake:__pkg__"],
)
Loading…
Cancel
Save