Merge "Make arm_on_x86 symmetric"
This commit is contained in:
commit
9f66306050
1 changed files with 28 additions and 4 deletions
|
@ -784,14 +784,18 @@ func (a *ModuleBase) setArchProperties(ctx BottomUpMutatorContext) {
|
||||||
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
if arch.ArchType == X86 && (hasArmAbi(arch) ||
|
if (arch.ArchType == X86 && (hasArmAbi(arch) ||
|
||||||
hasArmAndroidArch(ctx.Config().Targets[Device])) {
|
hasArmAndroidArch(ctx.Config().Targets[Device]))) ||
|
||||||
|
(arch.ArchType == Arm &&
|
||||||
|
hasX86AndroidArch(ctx.Config().Targets[Device])) {
|
||||||
field := "Arm_on_x86"
|
field := "Arm_on_x86"
|
||||||
prefix := "target.arm_on_x86"
|
prefix := "target.arm_on_x86"
|
||||||
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
||||||
}
|
}
|
||||||
if arch.ArchType == X86_64 && (hasArmAbi(arch) ||
|
if (arch.ArchType == X86_64 && (hasArmAbi(arch) ||
|
||||||
hasArmAndroidArch(ctx.Config().Targets[Device])) {
|
hasArmAndroidArch(ctx.Config().Targets[Device]))) ||
|
||||||
|
(arch.ArchType == Arm &&
|
||||||
|
hasX8664AndroidArch(ctx.Config().Targets[Device])) {
|
||||||
field := "Arm_on_x86_64"
|
field := "Arm_on_x86_64"
|
||||||
prefix := "target.arm_on_x86_64"
|
prefix := "target.arm_on_x86_64"
|
||||||
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
a.appendProperties(ctx, genProps, targetProp, field, prefix)
|
||||||
|
@ -914,6 +918,26 @@ func hasArmAndroidArch(targets []Target) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hasX86Arch returns true if targets has at least x86 Android arch
|
||||||
|
func hasX86AndroidArch(targets []Target) bool {
|
||||||
|
for _, target := range targets {
|
||||||
|
if target.Os == Android && target.Arch.ArchType == X86 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// hasX8664Arch returns true if targets has at least x86_64 Android arch
|
||||||
|
func hasX8664AndroidArch(targets []Target) bool {
|
||||||
|
for _, target := range targets {
|
||||||
|
if target.Os == Android && target.Arch.ArchType == X86_64 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
type archConfig struct {
|
type archConfig struct {
|
||||||
arch string
|
arch string
|
||||||
archVariant string
|
archVariant string
|
||||||
|
|
Loading…
Reference in a new issue