diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-04-24 17:36:17 +0000 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-04-24 17:36:17 +0000 |
commit | 985145ca16e4926420416e3a5f41f3e6e736c590 (patch) | |
tree | 5828b42ca49dbf656b651770714375620a720639 /build_defs.bzl | |
parent | d6e466e943f4454396a3d1f8001e927bfb740213 (diff) |
Fixed amalgamation and CMake build.
Diffstat (limited to 'build_defs.bzl')
-rw-r--r-- | build_defs.bzl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/build_defs.bzl b/build_defs.bzl index a03d2f4..9deb336 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -178,6 +178,9 @@ SrcList = provider( ) def _file_list_aspect_impl(target, ctx): + if SrcList in target: + return [] + srcs = [] hdrs = [] for src in ctx.rule.attr.srcs: @@ -200,7 +203,7 @@ def _upb_amalgamation(ctx): ctx.actions.run( inputs = inputs, outputs = ctx.outputs.outs, - arguments = ["", ctx.bin_dir.path + "/"] + [f.path for f in srcs], + arguments = [ctx.bin_dir.path + "/"] + [f.path for f in srcs] + ["-I" + root for root in _get_real_roots(inputs)], progress_message = "Making amalgamation", executable = ctx.executable.amalgamator, ) @@ -244,7 +247,7 @@ def _get_real_short_path(file): def _get_real_root(file): real_short_path = _get_real_short_path(file) - return file.path[:-len(real_short_path)] + return file.path[:-len(real_short_path) - 1] def _get_real_roots(files): roots = {} |