diff options
-rw-r--r-- | BUILD | 35 | ||||
-rw-r--r-- | build_defs.bzl | 25 | ||||
-rwxr-xr-x | tools/make_cmakelists.py | 3 |
3 files changed, 37 insertions, 26 deletions
@@ -1,6 +1,7 @@ load( ":build_defs.bzl", "generated_file_staleness_test", + "licenses", # copybara:strip_for_google3 "lua_binary", "lua_cclibrary", "lua_library", @@ -11,6 +12,21 @@ load( "upb_proto_reflection_library", ) +licenses(["notice"]) # BSD (Google-authored w/ possible external contributions) + +exports_files([ + "LICENSE", + "build_defs", +]) + +COPTS = [ + # copybara:strip_for_google3_begin + "-std=c89", + "-pedantic", + "-Wno-long-long", + # copybara:strip_end +] + # C/C++ rules ################################################################## cc_library( @@ -44,11 +60,7 @@ cc_library( "upb/sink.h", "upb/upb.h", ], - copts = [ - "-std=c89", - "-pedantic", - "-Wno-long-long", - ], + copts = COPTS, visibility = ["//visibility:public"], ) @@ -68,11 +80,7 @@ cc_library( "upb/pb/encoder.h", "upb/pb/textprinter.h", ], - copts = [ - "-std=c89", - "-pedantic", - "-Wno-long-long", - ], + copts = COPTS, deps = [ ":upb", ], @@ -88,11 +96,7 @@ cc_library( "upb/json/parser.h", "upb/json/printer.h", ], - copts = [ - "-std=c89", - "-pedantic", - "-Wno-long-long", - ], + copts = COPTS, deps = [ ":upb", ":upb_pb", @@ -309,6 +313,7 @@ cc_library( name = "amalgamation", srcs = ["upb.c"], hdrs = ["upb.h"], + copts = COPTS, ) # Lua libraries. ############################################################### diff --git a/build_defs.bzl b/build_defs.bzl index da21e86..bb4d6f8 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -1,4 +1,3 @@ - _shell_find_runfiles = """ # --- begin runfiles.bash initialization --- # Copy-pasted from Bazel's Bash runfiles library (tools/bash/runfiles/runfiles.bash). @@ -100,7 +99,7 @@ BASE=$(dirname $(rlocation upb/upb_c.so)) export LUA_CPATH="$BASE/?.so" export LUA_PATH="$BASE/?.lua" $(rlocation lua/lua) $(rlocation upb/tools/upbc.lua) "$@" -""" +""", ) rule( @@ -109,10 +108,10 @@ $(rlocation lua/lua) $(rlocation upb/tools/upbc.lua) "$@" data = ["@lua//:lua", "@bazel_tools//tools/bash/runfiles", luamain] + luadeps, ) -def lua_binary(name, luamain, luadeps=[]): +def lua_binary(name, luamain, luadeps = []): _lua_binary_or_test(name, luamain, luadeps, native.sh_binary) -def lua_test(name, luamain, luadeps=[]): +def lua_test(name, luamain, luadeps = []): _lua_binary_or_test(name, luamain, luadeps, native.sh_test) def generated_file_staleness_test(name, outs, generated_pattern): @@ -163,9 +162,9 @@ def generated_file_staleness_test(name, outs, generated_pattern): SrcList = provider( fields = { - 'srcs' : 'list of srcs', - 'hdrs' : 'list of hdrs', - } + "srcs": "list of srcs", + "hdrs": "list of hdrs", + }, ) def _file_list_aspect_impl(target, ctx): @@ -205,7 +204,7 @@ upb_amalgamation = rule( ), "libs": attr.label_list(aspects = [_file_list_aspect]), "outs": attr.output_list(), - } + }, ) # upb_proto_library() rule @@ -223,7 +222,7 @@ def _upb_proto_srcs_impl(ctx, suffix): outs = [] include_dirs = {} for dep in ctx.attr.deps: - if hasattr(dep, 'proto'): + if hasattr(dep, "proto"): for src in dep.proto.transitive_sources: sources.append(src) include_dir = _remove_suffix(src.path, _remove_up(src.short_path) + "." + src.extension) @@ -265,7 +264,7 @@ _upb_proto_library_srcs = rule( default = "@com_google_protobuf//:protoc", ), "deps": attr.label_list(), - } + }, ) def upb_proto_library(name, deps, upbc): @@ -295,7 +294,7 @@ _upb_proto_reflection_library_srcs = rule( default = "@com_google_protobuf//:protoc", ), "deps": attr.label_list(), - } + }, ) def upb_proto_reflection_library(name, deps, upbc): @@ -311,3 +310,7 @@ def upb_proto_reflection_library(name, deps, upbc): deps = [":upb"], copts = ["-Ibazel-out/k8-fastbuild/bin"], ) + +def licenses(*args): + # No-op (for Google-internal usage). + pass diff --git a/tools/make_cmakelists.py b/tools/make_cmakelists.py index c2700b6..1e1c1ee 100755 --- a/tools/make_cmakelists.py +++ b/tools/make_cmakelists.py @@ -137,6 +137,9 @@ class BuildFileFunctions(object): def glob(*args): return [] + def licenses(*args): + pass + class WorkspaceFileFunctions(object): def __init__(self, converter): |