Convert Visit*Deps from blueprint.Module to android.Module
Also adds checks that the dependencies are android.Modules and
are not disabled.
Test: m checkbuild
Change-Id: I05e945f38915d49cd3c0ab72a86576949bc7eff2
diff --git a/cc/cc.go b/cc/cc.go
index 36b97e1..b423ca6 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1037,16 +1037,10 @@
directStaticDeps := []*Module{}
- ctx.VisitDirectDeps(func(dep blueprint.Module) {
+ ctx.VisitDirectDeps(func(dep android.Module) {
depName := ctx.OtherModuleName(dep)
depTag := ctx.OtherModuleDependencyTag(dep)
- aDep, _ := dep.(android.Module)
- if aDep == nil {
- ctx.ModuleErrorf("module %q not an android module", depName)
- return
- }
-
ccDep, _ := dep.(*Module)
if ccDep == nil {
// handling for a few module types that aren't cc Module but that are also supported
@@ -1096,20 +1090,11 @@
return
}
- // some validation
- if !aDep.Enabled() {
- if ctx.AConfig().AllowMissingDependencies() {
- ctx.AddMissingDependencies([]string{depName})
- } else {
- ctx.ModuleErrorf("depends on disabled module %q", depName)
- }
- return
- }
- if aDep.Target().Os != ctx.Os() {
+ if dep.Target().Os != ctx.Os() {
ctx.ModuleErrorf("OS mismatch between %q and %q", ctx.ModuleName(), depName)
return
}
- if aDep.Target().Arch.ArchType != ctx.Arch().ArchType {
+ if dep.Target().Arch.ArchType != ctx.Arch().ArchType {
ctx.ModuleErrorf("Arch mismatch between %q and %q", ctx.ModuleName(), depName)
return
}