Merge "Build rust libraries against C ModuleLib API surface."

This commit is contained in:
Spandan Das
2023-03-21 17:22:23 +00:00
committed by Gerrit Code Review
2 changed files with 73 additions and 6 deletions

View File

@@ -2954,7 +2954,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
ctx.VisitDirectDeps(func(dep android.Module) {
depName := ctx.OtherModuleName(dep)
if apiLibrary, ok := targetOrigModuleList[depName]; ok {
if shouldUseStubForApex(ctx, dep) {
if ShouldUseStubForApex(ctx, dep) {
skipModuleList[depName] = true
} else {
skipModuleList[apiLibrary] = true
@@ -3307,7 +3307,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
return depPaths
}
func shouldUseStubForApex(ctx android.ModuleContext, dep android.Module) bool {
func ShouldUseStubForApex(ctx android.ModuleContext, dep android.Module) bool {
depName := ctx.OtherModuleName(dep)
thisModule, ok := ctx.Module().(android.ApexModule)
if !ok {
@@ -3409,7 +3409,7 @@ func ChooseStubOrImpl(ctx android.ModuleContext, dep android.Module) (SharedLibr
if !libDepTag.explicitlyVersioned && len(sharedLibraryStubsInfo.SharedStubLibraries) > 0 {
// when to use (unspecified) stubs, use the latest one.
if shouldUseStubForApex(ctx, dep) {
if ShouldUseStubForApex(ctx, dep) {
stubs := sharedLibraryStubsInfo.SharedStubLibraries
toUse := stubs[len(stubs)-1]
sharedLibraryInfo = toUse.SharedLibraryInfo