Prepare for a type-safe OnceKey
Add an opaque OnceKey type and use it for all calls to Once in build/soong. A future patch will convert the arguments to Once* to OnceKey once users outside build/soong have been updated. Test: onceper_test.go Change-Id: Ifcb338e6e603e804e507203c9508d30ffb2df966
This commit is contained in:
@@ -958,20 +958,26 @@ func sanitizerMutator(t sanitizerType) func(android.BottomUpMutatorContext) {
|
||||
}
|
||||
}
|
||||
|
||||
var cfiStaticLibsKey = android.NewOnceKey("cfiStaticLibs")
|
||||
|
||||
func cfiStaticLibs(config android.Config) *[]string {
|
||||
return config.Once("cfiStaticLibs", func() interface{} {
|
||||
return config.Once(cfiStaticLibsKey, func() interface{} {
|
||||
return &[]string{}
|
||||
}).(*[]string)
|
||||
}
|
||||
|
||||
var hwasanStaticLibsKey = android.NewOnceKey("hwasanStaticLibs")
|
||||
|
||||
func hwasanStaticLibs(config android.Config) *[]string {
|
||||
return config.Once("hwasanStaticLibs", func() interface{} {
|
||||
return config.Once(hwasanStaticLibsKey, func() interface{} {
|
||||
return &[]string{}
|
||||
}).(*[]string)
|
||||
}
|
||||
|
||||
var hwasanVendorStaticLibsKey = android.NewOnceKey("hwasanVendorStaticLibs")
|
||||
|
||||
func hwasanVendorStaticLibs(config android.Config) *[]string {
|
||||
return config.Once("hwasanVendorStaticLibs", func() interface{} {
|
||||
return config.Once(hwasanVendorStaticLibsKey, func() interface{} {
|
||||
return &[]string{}
|
||||
}).(*[]string)
|
||||
}
|
||||
|
Reference in New Issue
Block a user