Ignore disabled modules when generating ndk sysroot
When linux_bionic is turned on, there are two host modules for the
preprocessed ndk headers, but only one is enabled. So exit early for the
disabled one.
Bug: 31559095
Test: Diff out/soong/build.ninja before/after, no change.
Test: Turn on linux_bionic, no longer see a panic.
Change-Id: I204a884a83ccf21c96088e97c19a0cffe029ec99
diff --git a/cc/ndk_sysroot.go b/cc/ndk_sysroot.go
index 47dda27..2e4e395 100644
--- a/cc/ndk_sysroot.go
+++ b/cc/ndk_sysroot.go
@@ -90,6 +90,10 @@
installPaths := []string{}
licensePaths := []string{}
ctx.VisitAllModules(func(module blueprint.Module) {
+ if m, ok := module.(android.Module); ok && !m.Enabled() {
+ return
+ }
+
if m, ok := module.(*headerModule); ok {
installPaths = append(installPaths, m.installPaths...)
licensePaths = append(licensePaths, m.licensePath.String())