diff options
Diffstat (limited to 'android/arch.go')
-rw-r--r-- | android/arch.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/android/arch.go b/android/arch.go index e0c6908c1..6d896e5fc 100644 --- a/android/arch.go +++ b/android/arch.go @@ -19,6 +19,7 @@ import ( "fmt" "reflect" "runtime" + "slices" "strings" "github.com/google/blueprint" @@ -587,19 +588,21 @@ func archMutator(bpctx blueprint.BottomUpMutatorContext) { } osTargets := mctx.Config().Targets[os] + image := base.commonProperties.ImageVariation // Filter NativeBridge targets unless they are explicitly supported. // Skip creating native bridge variants for non-core modules. if os == Android && !(base.IsNativeBridgeSupported() && image == CoreVariation) { + osTargets = slices.DeleteFunc(slices.Clone(osTargets), func(t Target) bool { + return bool(t.NativeBridge) + }) + } - var targets []Target - for _, t := range osTargets { - if !t.NativeBridge { - targets = append(targets, t) - } - } - - osTargets = targets + // Filter HostCross targets if disabled. + if base.HostSupported() && !base.HostCrossSupported() { + osTargets = slices.DeleteFunc(slices.Clone(osTargets), func(t Target) bool { + return t.HostCross + }) } // only the primary arch in the ramdisk / vendor_ramdisk / recovery partition |