aboutsummaryrefslogtreecommitdiffstats
path: root/cc/cc.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/cc.go')
-rw-r--r--cc/cc.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/cc/cc.go b/cc/cc.go
index b9c589a1..e5eb8d8b 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -922,6 +922,16 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
}
} else if ctx.useVndk() && inList(entry, llndkLibraries) {
nonvariantLibs = append(nonvariantLibs, entry+llndkLibrarySuffix)
+ } else if (ctx.Platform() || ctx.ProductSpecific()) && inList(entry, vendorPublicLibraries) {
+ vendorPublicLib := entry + vendorPublicLibrarySuffix
+ if actx.OtherModuleExists(vendorPublicLib) {
+ nonvariantLibs = append(nonvariantLibs, vendorPublicLib)
+ } else {
+ // This can happen if vendor_public_library module is defined in a
+ // namespace that isn't visible to the current module. In that case,
+ // link to the original library.
+ nonvariantLibs = append(nonvariantLibs, entry)
+ }
} else {
nonvariantLibs = append(nonvariantLibs, entry)
}
@@ -1310,14 +1320,18 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
switch depTag {
case sharedDepTag, sharedExportDepTag, lateSharedDepTag:
libName := strings.TrimSuffix(depName, llndkLibrarySuffix)
+ libName = strings.TrimSuffix(libName, vendorPublicLibrarySuffix)
libName = strings.TrimPrefix(libName, "prebuilt_")
isLLndk := inList(libName, llndkLibraries)
+ isVendorPublicLib := inList(libName, vendorPublicLibraries)
var makeLibName string
bothVendorAndCoreVariantsExist := ccDep.hasVendorVariant() || isLLndk
if c.useVndk() && bothVendorAndCoreVariantsExist {
// The vendor module in Make will have been renamed to not conflict with the core
// module, so update the dependency name here accordingly.
makeLibName = libName + vendorSuffix
+ } else if (ctx.Platform() || ctx.ProductSpecific()) && isVendorPublicLib {
+ makeLibName = libName + vendorPublicLibrarySuffix
} else {
makeLibName = libName
}