diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-05-20 15:56:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-20 15:56:08 -0700 |
commit | 1a77fbce39f5a764e80a7e873da662b74dfc6fb0 (patch) | |
tree | 6f9ae3a0db4f0dd77fa0f890723d1477369e4df3 | |
parent | 7804454f683af4fa866b88a218faba32e1b6a9b1 (diff) | |
parent | 8a41e6cb123bded11789a1fff8bc63c94dcb09f9 (diff) |
Merge pull request #171 from haberman/master
Fixed amalgamation to not exclude upb/decode.c.
-rw-r--r-- | bazel/build_defs.bzl | 14 | ||||
-rwxr-xr-x | tools/amalgamate.py | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/bazel/build_defs.bzl b/bazel/build_defs.bzl index 44ef0a3..1ec80b3 100644 --- a/bazel/build_defs.bzl +++ b/bazel/build_defs.bzl @@ -169,24 +169,22 @@ def generated_file_staleness_test(name, outs, generated_pattern): SrcList = provider( fields = { "srcs": "list of srcs", - "hdrs": "list of hdrs", }, ) def _file_list_aspect_impl(target, ctx): if GeneratedSrcs in target: srcs = target[GeneratedSrcs] - return [SrcList(srcs = srcs.srcs, hdrs = srcs.hdrs)] + return [SrcList(srcs = srcs.srcs + srcs.hdrs)] srcs = [] - hdrs = [] for src in ctx.rule.attr.srcs: srcs += src.files.to_list() for hdr in ctx.rule.attr.hdrs: - hdrs += hdr.files.to_list() + srcs += hdr.files.to_list() for hdr in ctx.rule.attr.textual_hdrs: - hdrs += hdr.files.to_list() - return [SrcList(srcs = srcs, hdrs = hdrs)] + srcs += hdr.files.to_list() + return [SrcList(srcs = srcs)] _file_list_aspect = aspect( implementation = _file_list_aspect_impl, @@ -194,11 +192,9 @@ _file_list_aspect = aspect( def _upb_amalgamation(ctx): inputs = [] - srcs = [] for lib in ctx.attr.libs: inputs += lib[SrcList].srcs - inputs += lib[SrcList].hdrs - srcs += [src for src in lib[SrcList].srcs if src.path.endswith("c")] + srcs = [src for src in inputs if src.path.endswith("c")] ctx.actions.run( inputs = inputs, outputs = ctx.outputs.outs, diff --git a/tools/amalgamate.py b/tools/amalgamate.py index 16b34aa..bc083b3 100755 --- a/tools/amalgamate.py +++ b/tools/amalgamate.py @@ -66,7 +66,7 @@ output_path = sys.argv[1] amalgamator = Amalgamator(output_path) files = [] -for arg in sys.argv[3:]: +for arg in sys.argv[2:]: arg = arg.strip() if arg.startswith("-I"): amalgamator.add_include_path(arg[2:]) |