Don't emit make vars from disabled modules
Previously, disabled modules were able to emit make vars and this could
cause duplicated make var definitions when a prebuilt_build_tools is
enabled for both linux_glibc and linux_bionic.
Bug: 159685774
Test: m
Change-Id: I8570ae5aabb8199e7c3901921886bcfa849037fe
diff --git a/android/makevars.go b/android/makevars.go
index 86f4b42..003a9df 100644
--- a/android/makevars.go
+++ b/android/makevars.go
@@ -234,7 +234,7 @@
}
ctx.VisitAllModules(func(m Module) {
- if provider, ok := m.(ModuleMakeVarsProvider); ok {
+ if provider, ok := m.(ModuleMakeVarsProvider); ok && m.Enabled() {
mctx := &makeVarsContext{
SingletonContext: ctx,
}