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

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

Change-Id: I5a485022996f614ad133d4b2fcf1a1310b00535f
This commit is contained in:
Colin Cross
2021-12-09 04:30:49 +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 {