aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-10-16 11:03:10 -0700
committerColin Cross <ccross@android.com>2019-10-16 14:52:30 -0700
commit0f7d2ef3ac3b1875fab0fe721224ee22893ed194 (patch)
treed16fca4893a3c8a27e77225472f1c922fb5b8603
parente8ba308dcf0f04578e2cebb92a8a8347289761d3 (diff)
downloadbuild_soong-0f7d2ef3ac3b1875fab0fe721224ee22893ed194.tar.gz
build_soong-0f7d2ef3ac3b1875fab0fe721224ee22893ed194.tar.bz2
build_soong-0f7d2ef3ac3b1875fab0fe721224ee22893ed194.zip
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
-rw-r--r--android/androidmk.go6
-rw-r--r--android/arch.go23
-rw-r--r--android/config.go19
-rw-r--r--android/proto.go5
-rw-r--r--apex/apex.go71
-rw-r--r--cc/cc.go7
-rw-r--r--cc/sanitize.go10
-rw-r--r--genrule/genrule.go4
-rw-r--r--java/app.go6
-rw-r--r--java/device_host_converter.go10
-rw-r--r--java/device_host_converter_test.go6
-rw-r--r--java/java.go4
-rw-r--r--python/python.go13
-rw-r--r--rust/rust.go2
-rw-r--r--sdk/sdk.go5
15 files changed, 92 insertions, 99 deletions
diff --git a/android/androidmk.go b/android/androidmk.go
index 90713477..b66fd183 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -199,19 +199,19 @@ func (a *AndroidMkEntries) fillInEntries(config Config, bpPath string, mod bluep
switch amod.Os().Class {
case Host:
// Make cannot identify LOCAL_MODULE_HOST_ARCH:= common.
- if archStr != "common" {
+ if amod.Arch().ArchType != Common {
a.SetString("LOCAL_MODULE_HOST_ARCH", archStr)
}
host = true
case HostCross:
// Make cannot identify LOCAL_MODULE_HOST_CROSS_ARCH:= common.
- if archStr != "common" {
+ if amod.Arch().ArchType != Common {
a.SetString("LOCAL_MODULE_HOST_CROSS_ARCH", archStr)
}
host = true
case Device:
// Make cannot identify LOCAL_MODULE_TARGET_ARCH:= common.
- if archStr != "common" {
+ if amod.Arch().ArchType != Common {
if amod.Target().NativeBridge {
hostArchStr := amod.Target().NativeBridgeHostArchName
if hostArchStr != "" {
diff --git a/android/arch.go b/android/arch.go
index 348b0649..5887744e 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -22,9 +22,12 @@ import (
"strconv"
"strings"
+ "github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
+const COMMON_VARIANT = "common"
+
var (
archTypeList []ArchType
@@ -36,7 +39,7 @@ var (
X86_64 = newArch("x86_64", "lib64")
Common = ArchType{
- Name: "common",
+ Name: COMMON_VARIANT,
}
)
@@ -702,11 +705,23 @@ type Target struct {
}
func (target Target) String() string {
- variant := ""
+ return target.ArchVariation()
+}
+
+func (target Target) ArchVariation() string {
+ var variation string
if target.NativeBridge {
- variant = "native_bridge_"
+ variation = "native_bridge_"
+ }
+ variation += target.Arch.String()
+
+ return target.Os.String() + "_" + variation
+}
+
+func (target Target) Variations() []blueprint.Variation {
+ return []blueprint.Variation{
+ {Mutator: "arch", Variation: target.ArchVariation()},
}
- return target.Os.String() + "_" + variant + target.Arch.String()
}
// archMutator splits a module into a variant for each Target requested by the module. Target selection
diff --git a/android/config.go b/android/config.go
index 26c4e6eb..57737f17 100644
--- a/android/config.go
+++ b/android/config.go
@@ -89,9 +89,10 @@ type config struct {
ConfigFileName string
ProductVariablesFileName string
- Targets map[OsType][]Target
- BuildOsVariant string
- BuildOsCommonVariant string
+ Targets map[OsType][]Target
+ BuildOSTarget Target // the Target for tools run on the build machine
+ BuildOSCommonTarget Target // the Target for common (java) tools run on the build machine
+ AndroidCommonTarget Target // the Target for common modules for the Android device
// multilibConflicts for an ArchType is true if there is earlier configured device architecture with the same
// multilib value.
@@ -289,8 +290,9 @@ func TestArchConfig(buildDir string, env map[string]string) Config {
config.Targets[BuildOs] = config.Targets[BuildOs][:1]
}
- config.BuildOsVariant = config.Targets[BuildOs][0].String()
- config.BuildOsCommonVariant = getCommonTargets(config.Targets[BuildOs])[0].String()
+ config.BuildOSTarget = config.Targets[BuildOs][0]
+ config.BuildOSCommonTarget = getCommonTargets(config.Targets[BuildOs])[0]
+ config.AndroidCommonTarget = getCommonTargets(config.Targets[Android])[0]
config.TestProductVariables.DeviceArch = proptools.StringPtr("arm64")
config.TestProductVariables.DeviceArchVariant = proptools.StringPtr("armv8-a")
config.TestProductVariables.DeviceSecondaryArch = proptools.StringPtr("arm")
@@ -374,8 +376,11 @@ func NewConfig(srcDir, buildDir string) (Config, error) {
}
config.Targets = targets
- config.BuildOsVariant = targets[BuildOs][0].String()
- config.BuildOsCommonVariant = getCommonTargets(targets[BuildOs])[0].String()
+ config.BuildOSTarget = config.Targets[BuildOs][0]
+ config.BuildOSCommonTarget = getCommonTargets(config.Targets[BuildOs])[0]
+ if len(config.Targets[Android]) > 0 {
+ config.AndroidCommonTarget = getCommonTargets(config.Targets[Android])[0]
+ }
if err := config.fromEnv(); err != nil {
return Config{}, err
diff --git a/android/proto.go b/android/proto.go
index c8ade456..b712258e 100644
--- a/android/proto.go
+++ b/android/proto.go
@@ -52,9 +52,8 @@ func ProtoDeps(ctx BottomUpMutatorContext, p *ProtoProperties) {
}
if plugin := String(p.Proto.Plugin); plugin != "" {
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: ctx.Config().BuildOsVariant},
- }, ProtoPluginDepTag, "protoc-gen-"+plugin)
+ ctx.AddFarVariationDependencies(ctx.Config().BuildOSTarget.Variations(),
+ ProtoPluginDepTag, "protoc-gen-"+plugin)
}
}
diff --git a/apex/apex.go b/apex/apex.go
index 5f714259..b02346a7 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -589,28 +589,25 @@ type apexBundle struct {
func addDependenciesForNativeModules(ctx android.BottomUpMutatorContext,
native_shared_libs []string, binaries []string, tests []string,
- arch string, imageVariation string) {
+ target android.Target, imageVariation string) {
// Use *FarVariation* to be able to depend on modules having
// conflicting variations with this module. This is required since
// arch variant of an APEX bundle is 'common' but it is 'arm' or 'arm64'
// for native shared libs.
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: arch},
+ ctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{
{Mutator: "image", Variation: imageVariation},
{Mutator: "link", Variation: "shared"},
{Mutator: "version", Variation: ""}, // "" is the non-stub variant
- }, sharedLibTag, native_shared_libs...)
+ }...), sharedLibTag, native_shared_libs...)
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: arch},
- {Mutator: "image", Variation: imageVariation},
- }, executableTag, binaries...)
+ ctx.AddFarVariationDependencies(append(target.Variations(),
+ blueprint.Variation{Mutator: "image", Variation: imageVariation}),
+ executableTag, binaries...)
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: arch},
+ ctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{
{Mutator: "image", Variation: imageVariation},
{Mutator: "test_per_src", Variation: ""}, // "" is the all-tests variant
- }, testTag, tests...)
+ }...), testTag, tests...)
}
func (a *apexBundle) combineProperties(ctx android.BottomUpMutatorContext) {
@@ -642,49 +639,45 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
for i, target := range targets {
// When multilib.* is omitted for native_shared_libs, it implies
// multilib.both.
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: target.String()},
+ ctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{
{Mutator: "image", Variation: a.getImageVariation(config)},
{Mutator: "link", Variation: "shared"},
- }, sharedLibTag, a.properties.Native_shared_libs...)
+ }...), sharedLibTag, a.properties.Native_shared_libs...)
// When multilib.* is omitted for tests, it implies
// multilib.both.
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: target.String()},
+ ctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{
{Mutator: "image", Variation: a.getImageVariation(config)},
{Mutator: "test_per_src", Variation: ""}, // "" is the all-tests variant
- }, testTag, a.properties.Tests...)
+ }...), testTag, a.properties.Tests...)
// Add native modules targetting both ABIs
addDependenciesForNativeModules(ctx,
a.properties.Multilib.Both.Native_shared_libs,
a.properties.Multilib.Both.Binaries,
a.properties.Multilib.Both.Tests,
- target.String(),
+ target,
a.getImageVariation(config))
isPrimaryAbi := i == 0
if isPrimaryAbi {
// When multilib.* is omitted for binaries, it implies
// multilib.first.
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: target.String()},
- {Mutator: "image", Variation: a.getImageVariation(config)},
- }, executableTag, a.properties.Binaries...)
+ ctx.AddFarVariationDependencies(append(target.Variations(),
+ blueprint.Variation{Mutator: "image", Variation: a.getImageVariation(config)}),
+ executableTag, a.properties.Binaries...)
// Add native modules targetting the first ABI
addDependenciesForNativeModules(ctx,
a.properties.Multilib.First.Native_shared_libs,
a.properties.Multilib.First.Binaries,
a.properties.Multilib.First.Tests,
- target.String(),
+ target,
a.getImageVariation(config))
// When multilib.* is omitted for prebuilts, it implies multilib.first.
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: target.String()},
- }, prebuiltTag, a.properties.Prebuilts...)
+ ctx.AddFarVariationDependencies(target.Variations(),
+ prebuiltTag, a.properties.Prebuilts...)
}
switch target.Arch.ArchType.Multilib {
@@ -694,14 +687,14 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
a.properties.Multilib.Lib32.Native_shared_libs,
a.properties.Multilib.Lib32.Binaries,
a.properties.Multilib.Lib32.Tests,
- target.String(),
+ target,
a.getImageVariation(config))
addDependenciesForNativeModules(ctx,
a.properties.Multilib.Prefer32.Native_shared_libs,
a.properties.Multilib.Prefer32.Binaries,
a.properties.Multilib.Prefer32.Tests,
- target.String(),
+ target,
a.getImageVariation(config))
case "lib64":
// Add native modules targetting 64-bit ABI
@@ -709,7 +702,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
a.properties.Multilib.Lib64.Native_shared_libs,
a.properties.Multilib.Lib64.Binaries,
a.properties.Multilib.Lib64.Tests,
- target.String(),
+ target,
a.getImageVariation(config))
if !has32BitTarget {
@@ -717,7 +710,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
a.properties.Multilib.Prefer32.Native_shared_libs,
a.properties.Multilib.Prefer32.Binaries,
a.properties.Multilib.Prefer32.Tests,
- target.String(),
+ target,
a.getImageVariation(config))
}
@@ -726,7 +719,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
if sanitizer == "hwaddress" {
addDependenciesForNativeModules(ctx,
[]string{"libclang_rt.hwasan-aarch64-android"},
- nil, nil, target.String(), a.getImageVariation(config))
+ nil, nil, target, a.getImageVariation(config))
break
}
}
@@ -735,13 +728,11 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
}
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: "android_common"},
- }, javaLibTag, a.properties.Java_libs...)
+ ctx.AddFarVariationDependencies(ctx.Config().AndroidCommonTarget.Variations(),
+ javaLibTag, a.properties.Java_libs...)
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: "android_common"},
- }, androidAppTag, a.properties.Apps...)
+ ctx.AddFarVariationDependencies(ctx.Config().AndroidCommonTarget.Variations(),
+ androidAppTag, a.properties.Apps...)
if String(a.properties.Key) == "" {
ctx.ModuleErrorf("key is missing")
@@ -1645,17 +1636,17 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, name, moduleDir string, apex
host := false
switch fi.module.Target().Os.Class {
case android.Host:
- if archStr != "common" {
+ if fi.module.Target().Arch.ArchType != android.Common {
fmt.Fprintln(w, "LOCAL_MODULE_HOST_ARCH :=", archStr)
}
host = true
case android.HostCross:
- if archStr != "common" {
+ if fi.module.Target().Arch.ArchType != android.Common {
fmt.Fprintln(w, "LOCAL_MODULE_HOST_CROSS_ARCH :=", archStr)
}
host = true
case android.Device:
- if archStr != "common" {
+ if fi.module.Target().Arch.ArchType != android.Common {
fmt.Fprintln(w, "LOCAL_MODULE_TARGET_ARCH :=", archStr)
}
}
diff --git a/cc/cc.go b/cc/cc.go
index 0f2cb4c9..5c0aeb2a 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1387,10 +1387,9 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
depTag = headerExportDepTag
}
if buildStubs {
- actx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: ctx.Target().String()},
- {Mutator: "image", Variation: c.imageVariation()},
- }, depTag, lib)
+ actx.AddFarVariationDependencies(append(ctx.Target().Variations(),
+ blueprint.Variation{Mutator: "image", Variation: c.imageVariation()}),
+ depTag, lib)
} else {
actx.AddVariationDependencies(nil, depTag, lib)
}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index c0a7c63e..f568d5a6 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -878,18 +878,16 @@ func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
// added to libFlags and LOCAL_SHARED_LIBRARIES by cc.Module
if c.staticBinary() {
// static executable gets static runtime libs
- mctx.AddFarVariationDependencies([]blueprint.Variation{
+ mctx.AddFarVariationDependencies(append(mctx.Target().Variations(), []blueprint.Variation{
{Mutator: "link", Variation: "static"},
{Mutator: "image", Variation: c.imageVariation()},
- {Mutator: "arch", Variation: mctx.Target().String()},
- }, staticDepTag, runtimeLibrary)
+ }...), staticDepTag, runtimeLibrary)
} else if !c.static() && !c.header() {
// dynamic executable and shared libs get shared runtime libs
- mctx.AddFarVariationDependencies([]blueprint.Variation{
+ mctx.AddFarVariationDependencies(append(mctx.Target().Variations(), []blueprint.Variation{
{Mutator: "link", Variation: "shared"},
{Mutator: "image", Variation: c.imageVariation()},
- {Mutator: "arch", Variation: mctx.Target().String()},
- }, earlySharedDepTag, runtimeLibrary)
+ }...), earlySharedDepTag, runtimeLibrary)
}
// static lib does not have dependency to the runtime library. The
// dependency will be added to the executables or shared libs using
diff --git a/genrule/genrule.go b/genrule/genrule.go
index c21df4c5..a7c5d65f 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -172,9 +172,7 @@ func (g *Module) DepsMutator(ctx android.BottomUpMutatorContext) {
if m := android.SrcIsModule(tool); m != "" {
tool = m
}
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: ctx.Config().BuildOsVariant},
- }, tag, tool)
+ ctx.AddFarVariationDependencies(ctx.Config().BuildOSTarget.Variations(), tag, tool)
}
}
}
diff --git a/java/app.go b/java/app.go
index e0336617..6b640f1c 100644
--- a/java/app.go
+++ b/java/app.go
@@ -167,10 +167,8 @@ func (a *AndroidApp) DepsMutator(ctx android.BottomUpMutatorContext) {
embedJni := a.shouldEmbedJnis(ctx)
for _, jniTarget := range ctx.MultiTargets() {
- variation := []blueprint.Variation{
- {Mutator: "arch", Variation: jniTarget.String()},
- {Mutator: "link", Variation: "shared"},
- }
+ variation := append(jniTarget.Variations(),
+ blueprint.Variation{Mutator: "link", Variation: "shared"})
tag := &jniDependencyTag{
target: jniTarget,
}
diff --git a/java/device_host_converter.go b/java/device_host_converter.go
index 030b0106..14db5215 100644
--- a/java/device_host_converter.go
+++ b/java/device_host_converter.go
@@ -18,8 +18,6 @@ import (
"fmt"
"io"
- "github.com/google/blueprint"
-
"android/soong/android"
)
@@ -83,13 +81,13 @@ func HostForDeviceFactory() android.Module {
var deviceHostConverterDepTag = dependencyTag{name: "device_host_converter"}
func (d *DeviceForHost) DepsMutator(ctx android.BottomUpMutatorContext) {
- variation := []blueprint.Variation{{Mutator: "arch", Variation: "android_common"}}
- ctx.AddFarVariationDependencies(variation, deviceHostConverterDepTag, d.properties.Libs...)
+ ctx.AddFarVariationDependencies(ctx.Config().AndroidCommonTarget.Variations(),
+ deviceHostConverterDepTag, d.properties.Libs...)
}
func (d *HostForDevice) DepsMutator(ctx android.BottomUpMutatorContext) {
- variation := []blueprint.Variation{{Mutator: "arch", Variation: ctx.Config().BuildOsCommonVariant}}
- ctx.AddFarVariationDependencies(variation, deviceHostConverterDepTag, d.properties.Libs...)
+ ctx.AddFarVariationDependencies(ctx.Config().BuildOSCommonTarget.Variations(),
+ deviceHostConverterDepTag, d.properties.Libs...)
}
func (d *DeviceHostConverter) GenerateAndroidBuildActions(ctx android.ModuleContext) {
diff --git a/java/device_host_converter_test.go b/java/device_host_converter_test.go
index 44aae9b3..3c9a0f3f 100644
--- a/java/device_host_converter_test.go
+++ b/java/device_host_converter_test.go
@@ -60,7 +60,7 @@ func TestDeviceForHost(t *testing.T) {
deviceImportModule := ctx.ModuleForTests("device_import_module", "android_common")
deviceImportCombined := deviceImportModule.Output("combined/device_import_module.jar")
- hostModule := ctx.ModuleForTests("host_module", config.BuildOsCommonVariant)
+ hostModule := ctx.ModuleForTests("host_module", config.BuildOSCommonTarget.String())
hostJavac := hostModule.Output("javac/host_module.jar")
hostRes := hostModule.Output("res/host_module.jar")
combined := hostModule.Output("combined/host_module.jar")
@@ -133,11 +133,11 @@ func TestHostForDevice(t *testing.T) {
ctx, config := testJava(t, bp)
- hostModule := ctx.ModuleForTests("host_module", config.BuildOsCommonVariant)
+ hostModule := ctx.ModuleForTests("host_module", config.BuildOSCommonTarget.String())
hostJavac := hostModule.Output("javac/host_module.jar")
hostRes := hostModule.Output("res/host_module.jar")
- hostImportModule := ctx.ModuleForTests("host_import_module", config.BuildOsCommonVariant)
+ hostImportModule := ctx.ModuleForTests("host_import_module", config.BuildOSCommonTarget.String())
hostImportCombined := hostImportModule.Output("combined/host_import_module.jar")
deviceModule := ctx.ModuleForTests("device_module", "android_common")
diff --git a/java/java.go b/java/java.go
index 4264ba90..47fb1a7b 100644
--- a/java/java.go
+++ b/java/java.go
@@ -546,9 +546,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...)
ctx.AddVariationDependencies(nil, staticLibTag, j.properties.Static_libs...)
- ctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: ctx.Config().BuildOsCommonVariant},
- }, pluginTag, j.properties.Plugins...)
+ ctx.AddFarVariationDependencies(ctx.Config().BuildOSCommonTarget.Variations(), pluginTag, j.properties.Plugins...)
android.ProtoDeps(ctx, &j.protoProperties)
if j.hasSrcExt(".proto") {
diff --git a/python/python.go b/python/python.go
index ad089090..1b606cbb 100644
--- a/python/python.go
+++ b/python/python.go
@@ -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")
}
}
diff --git a/rust/rust.go b/rust/rust.go
index 61b51e54..4f5e7fb9 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -496,7 +496,7 @@ func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) {
}
// proc_macros are compiler plugins, and so we need the host arch variant as a dependendcy.
- actx.AddFarVariationDependencies([]blueprint.Variation{{Mutator: "arch", Variation: ctx.Config().BuildOsVariant}}, procMacroDepTag, deps.ProcMacros...)
+ actx.AddFarVariationDependencies(ctx.Config().BuildOSTarget.Variations(), procMacroDepTag, deps.ProcMacros...)
}
func (mod *Module) Name() string {
diff --git a/sdk/sdk.go b/sdk/sdk.go
index fcb3fb7f..3736103f 100644
--- a/sdk/sdk.go
+++ b/sdk/sdk.go
@@ -101,11 +101,10 @@ func memberMutator(mctx android.BottomUpMutatorContext) {
targets := mctx.MultiTargets()
for _, target := range targets {
- mctx.AddFarVariationDependencies([]blueprint.Variation{
- {Mutator: "arch", Variation: target.String()},
+ mctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{
{Mutator: "image", Variation: "core"},
{Mutator: "link", Variation: "shared"},
- }, sdkMemberDepTag, m.properties.Native_shared_libs...)
+ }...), sdkMemberDepTag, m.properties.Native_shared_libs...)
}
}
}