Allow disabled dependencies when SOONG_ALLOW_MISSING_DEPENDENCIES is set
Push the "depens on a disabled module" dependency to runtime when
SOONG_ALLOW_MISSING_DEPENDENCIES is set so that subsets of the tree
can build when some modules are disabled.
Test: external/clang/build.py on llvm branch
Change-Id: I47e4f41d04aa3df173757f03a0c581b0bafb93f0
diff --git a/cc/cc.go b/cc/cc.go
index 6525047..0ea4713 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -834,7 +834,11 @@
}
if !a.Enabled() {
- ctx.ModuleErrorf("depends on disabled module %q", name)
+ if ctx.AConfig().AllowMissingDependencies() {
+ ctx.AddMissingDependencies([]string{name})
+ } else {
+ ctx.ModuleErrorf("depends on disabled module %q", name)
+ }
return
}