Add the ability to select on arch
Bug: 323382414
Test: go test
Change-Id: I0d4cf391a1a625c5160456db1f4f7fa424c2141e
diff --git a/android/base_module_context.go b/android/base_module_context.go
index 9be3fad..3367b06 100644
--- a/android/base_module_context.go
+++ b/android/base_module_context.go
@@ -599,7 +599,14 @@
}
return "", false
case parser.SelectTypeVariant:
- m.ModuleErrorf("TODO(b/323382414): Variants are not yet supported in selects")
+ if condition == "arch" {
+ if !m.ArchReady() {
+ m.ModuleErrorf("A select on arch was attempted before the arch mutator ran")
+ return "", false
+ }
+ return m.Arch().ArchType.Name, true
+ }
+ m.ModuleErrorf("Unknown variant " + condition)
return "", false
default:
panic("Should be unreachable")