Merge "Revert "rust: Only allow bindgen to produce rlibs."" am: d13d15a9c0

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2170067

Change-Id: I8ad271de87803942a99f899d90f36f8cbbb1e774
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Matthew Maurer 2022-08-01 22:41:40 +00:00 committed by Automerger Merge Worker
commit b0bb92726e
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)