Add method to determine variations from a Target

The arch variants are hardcoded in every module type.  Refactor
them out into a Target.Variations() method in preparation for
splitting the arch mutator into two, which will require using
different variations.

Test: m checkbuild
Change-Id: I28ef7cd5168095ac888fe77f04e27f9ad81978c0
This commit is contained in:
Colin Cross
2019-10-16 11:03:10 -07:00
parent e8ba308dcf
commit 0f7d2ef3ac
15 changed files with 92 additions and 99 deletions

View File

@@ -306,22 +306,17 @@ func (p *Module) DepsMutator(ctx android.BottomUpMutatorContext) {
if p.bootstrapper.autorun() {
launcherModule = "py2-launcher-autorun"
}
ctx.AddFarVariationDependencies([]blueprint.Variation{
{Mutator: "arch", Variation: ctx.Target().String()},
}, launcherTag, launcherModule)
ctx.AddFarVariationDependencies(ctx.Target().Variations(), launcherTag, launcherModule)
// Add py2-launcher shared lib dependencies. Ideally, these should be
// derived from the `shared_libs` property of "py2-launcher". However, we
// cannot read the property at this stage and it will be too late to add
// dependencies later.
ctx.AddFarVariationDependencies([]blueprint.Variation{
{Mutator: "arch", Variation: ctx.Target().String()},
}, launcherSharedLibTag, "libsqlite")
ctx.AddFarVariationDependencies(ctx.Target().Variations(), launcherSharedLibTag, "libsqlite")
if ctx.Target().Os.Bionic() {
ctx.AddFarVariationDependencies([]blueprint.Variation{
{Mutator: "arch", Variation: ctx.Target().String()},
}, launcherSharedLibTag, "libc", "libdl", "libm")
ctx.AddFarVariationDependencies(ctx.Target().Variations(), launcherSharedLibTag,
"libc", "libdl", "libm")
}
}