Merge changes from topic "far-dep-exists" am: 79610d55fa

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1714569

Change-Id: I10c7a86a27a11a16bb63825059856f9286cb3492
This commit is contained in:
Bill Peckham
2021-05-21 02:01:42 +00:00
committed by Automerger Merge Worker

View File

@@ -454,13 +454,30 @@ func (p *baseSnapshotDecorator) snapshotAndroidMkSuffix() string {
} }
func (p *baseSnapshotDecorator) setSnapshotAndroidMkSuffix(ctx android.ModuleContext) { func (p *baseSnapshotDecorator) setSnapshotAndroidMkSuffix(ctx android.ModuleContext) {
if ctx.OtherModuleDependencyVariantExists([]blueprint.Variation{ coreVariations := append(ctx.Target().Variations(), blueprint.Variation{
{Mutator: "image", Variation: android.CoreVariation}, Mutator: "image",
}, ctx.Module().(*Module).BaseModuleName()) { Variation: android.CoreVariation})
if ctx.OtherModuleFarDependencyVariantExists(coreVariations, ctx.Module().(*Module).BaseModuleName()) {
p.baseProperties.Androidmk_suffix = p.image.moduleNameSuffix() p.baseProperties.Androidmk_suffix = p.image.moduleNameSuffix()
} else { return
p.baseProperties.Androidmk_suffix = ""
} }
// If there is no matching core variation, there could still be a
// product variation, for example if a module is product specific and
// vendor available. In that case, we also want to add the androidmk
// suffix.
productVariations := append(ctx.Target().Variations(), blueprint.Variation{
Mutator: "image",
Variation: ProductVariationPrefix + ctx.DeviceConfig().PlatformVndkVersion()})
if ctx.OtherModuleFarDependencyVariantExists(productVariations, ctx.Module().(*Module).BaseModuleName()) {
p.baseProperties.Androidmk_suffix = p.image.moduleNameSuffix()
return
}
p.baseProperties.Androidmk_suffix = ""
} }
// Call this with a module suffix after creating a snapshot module, such as // Call this with a module suffix after creating a snapshot module, such as