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
This commit is contained in:
Colin Cross
2017-10-23 17:59:01 -07:00
parent b671544973
commit d11fcda940
15 changed files with 166 additions and 67 deletions

View File

@@ -1037,16 +1037,10 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
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 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
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
}