Pass SdkMember to AddPrebuiltModule instead of the name
This is needed for a follow up change that makes sure that the
prebuilt modules have the same visibility as the source modules.
Bug: 143678475
Test: m conscrypt-module-sdk
Change-Id: I9461c8c094ab19ee9ececb5e5fd50565789f2fa2
diff --git a/cc/library.go b/cc/library.go
index 60b00b1..4faf68d 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1435,10 +1435,10 @@
// copy exported header files and stub *.so files
func (mt *librarySdkMemberType) BuildSnapshot(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder, member android.SdkMember) {
info := organizeVariants(member)
- buildSharedNativeLibSnapshot(sdkModuleContext, info, builder)
+ buildSharedNativeLibSnapshot(sdkModuleContext, info, builder, member)
}
-func buildSharedNativeLibSnapshot(sdkModuleContext android.ModuleContext, info *nativeLibInfo, builder android.SnapshotBuilder) {
+func buildSharedNativeLibSnapshot(sdkModuleContext android.ModuleContext, info *nativeLibInfo, builder android.SnapshotBuilder, member android.SdkMember) {
// a function for emitting include dirs
printExportedDirCopyCommandsForNativeLibs := func(lib archSpecificNativeLibInfo) {
includeDirs := lib.exportedIncludeDirs
@@ -1489,10 +1489,10 @@
}
}
- info.generatePrebuiltLibrary(sdkModuleContext, builder)
+ info.generatePrebuiltLibrary(sdkModuleContext, builder, member)
}
-func (info *nativeLibInfo) generatePrebuiltLibrary(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder) {
+func (info *nativeLibInfo) generatePrebuiltLibrary(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder, member android.SdkMember) {
// a function for emitting include dirs
addExportedDirsForNativeLibs := func(lib archSpecificNativeLibInfo, properties android.BpPropertySet, systemInclude bool) {
@@ -1509,7 +1509,7 @@
properties.AddProperty(propertyName, includeDirs)
}
- pbm := builder.AddPrebuiltModule(info.name, "cc_prebuilt_library_shared")
+ pbm := builder.AddPrebuiltModule(member, "cc_prebuilt_library_shared")
if !info.hasArchSpecificFlags {
addExportedDirsForNativeLibs(info.archVariants[0], pbm, false /*systemInclude*/)