From 985145ca16e4926420416e3a5f41f3e6e736c590 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 24 Apr 2019 17:36:17 +0000 Subject: Fixed amalgamation and CMake build. --- build_defs.bzl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'build_defs.bzl') 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 = {} -- cgit v1.2.3