Merge "Revert^3 "rust: Only allow bindgen to produce rlibs.""

This commit is contained in:
Matthew Maurer 2022-08-02 23:28:26 +00:00 committed by Gerrit Code Review
commit 801b058fe3
3 changed files with 3 additions and 14 deletions

View file

@ -299,15 +299,7 @@ func NewRustBindgen(hod android.HostOrDeviceSupported) (*Module, *bindgenDecorat
ClangProperties: cc.RustBindgenClangProperties{},
}
module := NewSourceProviderModule(hod, bindgen, false, true)
android.AddLoadHook(module, func(ctx android.LoadHookContext) {
type stub_props struct {
Visibility []string
}
props := &stub_props{[]string{":__subpackages__"}}
ctx.PrependProperties(props)
})
module := NewSourceProviderModule(hod, bindgen, false)
return module, bindgen
}

View file

@ -238,7 +238,7 @@ func NewRustProtobuf(hod android.HostOrDeviceSupported) (*Module, *protobufDecor
Properties: ProtobufProperties{},
}
module := NewSourceProviderModule(hod, protobuf, false, false)
module := NewSourceProviderModule(hod, protobuf, false)
return module, protobuf
}

View file

@ -65,12 +65,9 @@ func NewSourceProvider() *BaseSourceProvider {
}
}
func NewSourceProviderModule(hod android.HostOrDeviceSupported, sourceProvider SourceProvider, enableLints bool, rlibOnly bool) *Module {
func NewSourceProviderModule(hod android.HostOrDeviceSupported, sourceProvider SourceProvider, enableLints bool) *Module {
_, library := NewRustLibrary(hod)
library.BuildOnlyRust()
if rlibOnly {
library.BuildOnlyRlib()
}
library.sourceProvider = sourceProvider
module := newModule(hod, android.MultilibBoth)