diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2021-05-22 12:54:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-05-22 12:54:47 +0000 |
commit | 5ff8e3f56774c7a3cfc41084c21db24b5899b821 (patch) | |
tree | b0bc8123f608fee903c4a9828ae51b8558f59a01 /cc | |
parent | dcabea581cb855ee9a735781e25c3375862875ff (diff) | |
parent | 8f37844151770ff0de1fa4425d67b85e00fa1c0c (diff) |
Merge changes from topic "far-dep-exists" into sc-dev
* changes:
Check for product variant in addition to core variant.
Plumb through OtherModuleFarDependencyVariantExists from blueprint.
Diffstat (limited to 'cc')
-rw-r--r-- | cc/snapshot_prebuilt.go | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/cc/snapshot_prebuilt.go b/cc/snapshot_prebuilt.go index 0b1147ef2..a7351a9ef 100644 --- a/cc/snapshot_prebuilt.go +++ b/cc/snapshot_prebuilt.go @@ -454,13 +454,30 @@ func (p *baseSnapshotDecorator) snapshotAndroidMkSuffix() string { } func (p *baseSnapshotDecorator) setSnapshotAndroidMkSuffix(ctx android.ModuleContext) { - if ctx.OtherModuleDependencyVariantExists([]blueprint.Variation{ - {Mutator: "image", Variation: android.CoreVariation}, - }, ctx.Module().(*Module).BaseModuleName()) { + coreVariations := append(ctx.Target().Variations(), blueprint.Variation{ + Mutator: "image", + Variation: android.CoreVariation}) + + if ctx.OtherModuleFarDependencyVariantExists(coreVariations, ctx.Module().(*Module).BaseModuleName()) { p.baseProperties.Androidmk_suffix = p.image.moduleNameSuffix() - } else { - p.baseProperties.Androidmk_suffix = "" + return + } + + // 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 |