summaryrefslogtreecommitdiff
path: root/build_defs.bzl
diff options
context:
space:
mode:
authorJosh Haberman <haberman@google.com>2019-04-23 22:41:00 +0000
committerJosh Haberman <haberman@google.com>2019-04-23 22:41:00 +0000
commit9fa3e8bd62ecc6692847a389b80c11efbe86eb57 (patch)
treee7d3722788fbe04e02c445c672cbbf00b1e35925 /build_defs.bzl
parent239d4a90db56b4c4208cd0317a6daa43c48b4ded (diff)
Fix the Ubuntu build.
Diffstat (limited to 'build_defs.bzl')
-rw-r--r--build_defs.bzl21
1 files changed, 16 insertions, 5 deletions
diff --git a/build_defs.bzl b/build_defs.bzl
index 667db8a..d39db4d 100644
--- a/build_defs.bzl
+++ b/build_defs.bzl
@@ -406,18 +406,29 @@ _upb_proto_library_aspect = aspect(
fragments = ["cpp"],
)
+
+def filter_none(elems):
+ out = []
+ for elem in elems:
+ if elem:
+ out.append(elem)
+ return out
+
+
def _upb_proto_library_impl(ctx):
if len(ctx.attr.deps) != 1:
fail("only one deps dependency allowed.")
dep = ctx.attr.deps[0]
if CcInfo not in dep:
fail("proto_library rule must generate CcInfo (have cc_api_version>0).")
+ lib = dep[CcInfo].linking_context.libraries_to_link[0]
+ files = filter_none([
+ lib.static_library,
+ lib.pic_static_library,
+ lib.dynamic_library,
+ ])
return [
- DefaultInfo(
- files = depset(
- [dep[CcInfo].linking_context.libraries_to_link[0].static_library],
- ),
- ),
+ DefaultInfo(files = depset(files)),
dep[CcInfo],
]
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback