Merge "Don't panic when DevicePrimaryArchType is called in a host only build" am: 9f5a9d1d54 am: 11f79516e2

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915495

Change-Id: I95d0da7bb0db8455a5ced458c9dc53bdce01fdbf
This commit is contained in:
Colin Cross
2021-12-09 04:52:52 +00:00
committed by Automerger Merge Worker

View File

@@ -892,8 +892,13 @@ func (c *config) Eng() bool {
return Bool(c.productVariables.Eng)
}
// DevicePrimaryArchType returns the ArchType for the first configured device architecture, or
// Common if there are no device architectures.
func (c *config) DevicePrimaryArchType() ArchType {
return c.Targets[Android][0].Arch.ArchType
if androidTargets := c.Targets[Android]; len(androidTargets) > 0 {
return androidTargets[0].Arch.ArchType
}
return Common
}
func (c *config) SanitizeHost() []string {