Merge "Add libraryDependencyTag to track dependencies on static and shared libraries"

This commit is contained in:
Colin Cross
2020-08-06 00:06:28 +00:00
committed by Gerrit Code Review
12 changed files with 465 additions and 343 deletions

View File

@@ -105,10 +105,14 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags
// For static libraries, the only thing that changes our object files
// are included whole static libraries, so check to see if any of
// those have coverage enabled.
ctx.VisitDirectDepsWithTag(wholeStaticDepTag, func(m android.Module) {
if cc, ok := m.(*Module); ok && cc.coverage != nil {
if cc.coverage.linkCoverage {
cov.linkCoverage = true
ctx.VisitDirectDeps(func(m android.Module) {
if depTag, ok := ctx.OtherModuleDependencyTag(m).(libraryDependencyTag); ok {
if depTag.static() && depTag.wholeStatic {
if cc, ok := m.(*Module); ok && cc.coverage != nil {
if cc.coverage.linkCoverage {
cov.linkCoverage = true
}
}
}
}
})