Add a rust_bindgen_host module type.

Bug: 161826371
Test: Local rust_bindgen_host only provides host variants.
Change-Id: I8cc7819a193a6eefe40402e4b6a82f436c5de78a
This commit is contained in:
Ivan Lozano 2020-07-22 16:30:20 -04:00
parent 07cbaf4d89
commit f6fe9956bf
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,7 @@ var (
func init() { func init() {
android.RegisterModuleType("rust_bindgen", RustBindgenFactory) android.RegisterModuleType("rust_bindgen", RustBindgenFactory)
android.RegisterModuleType("rust_bindgen_host", RustBindgenHostFactory)
} }
var _ SourceProvider = (*bindgenDecorator)(nil) var _ SourceProvider = (*bindgenDecorator)(nil)
@ -152,6 +153,11 @@ func RustBindgenFactory() android.Module {
return module.Init() return module.Init()
} }
func RustBindgenHostFactory() android.Module {
module, _ := NewRustBindgen(android.HostSupported)
return module.Init()
}
func NewRustBindgen(hod android.HostOrDeviceSupported) (*Module, *bindgenDecorator) { func NewRustBindgen(hod android.HostOrDeviceSupported) (*Module, *bindgenDecorator) {
module := newModule(hod, android.MultilibBoth) module := newModule(hod, android.MultilibBoth)