bp2build: support generated sources and hdrs
There are two pieces to make this work:
1. Local include paths must include $(BINDIR)-relative paths, to support
generated headers in those directories.
2. The srcs that bp2build outputs for BUILD targets must include labels
for targets given in generated_hdrs and generated_srcs.
Support for exported_generated_hdrs intentionally deferred.
This allows us to remove several targets from the bp2build denylist.
Some are moved to the mixed build denylist, because genreated headers are
still unsupported in mixed builds.
Test: bp2build.sh CI script
Change-Id: Ib4f9dac20f6445487b8dad53b91eac01f437a590
diff --git a/bazel/properties.go b/bazel/properties.go
index a71b12b..3e778bb 100644
--- a/bazel/properties.go
+++ b/bazel/properties.go
@@ -160,6 +160,14 @@
return labels
}
+// Appends two LabelLists, returning the combined list.
+func AppendBazelLabelLists(a LabelList, b LabelList) LabelList {
+ var result LabelList
+ result.Includes = append(a.Includes, b.Includes...)
+ result.Excludes = append(a.Excludes, b.Excludes...)
+ return result
+}
+
// Subtract needle from haystack
func SubtractBazelLabelList(haystack LabelList, needle LabelList) LabelList {
var result LabelList