Add the ability to select on arch

Bug: 323382414
Test: go test
Change-Id: I0d4cf391a1a625c5160456db1f4f7fa424c2141e
This commit is contained in:
Cole Faust
2024-03-20 12:28:03 -07:00
parent 949157d582
commit 0aa21cc8e2
5 changed files with 44 additions and 4 deletions

View File

@@ -35,6 +35,7 @@ type ArchModuleContext interface {
type archModuleContext struct {
// TODO: these should eventually go through a (possibly cached) provider like any other configuration instead
// of being special cased.
ready bool
os OsType
target Target
targetPrimary bool
@@ -42,6 +43,13 @@ type archModuleContext struct {
primaryArch bool
}
// ArchReady returns true if the arch mutator has run on the module. Before this returns
// true, the module essentially doesn't have an arch and cannot make decisions based on
// architecture.
func (a *archModuleContext) ArchReady() bool {
return a.ready
}
func (a *archModuleContext) Target() Target {
return a.target
}