Loading cc/library_sdk_member.go +24 −20 Original line number Diff line number Diff line Loading @@ -241,8 +241,30 @@ func buildSharedNativeLibSnapshot(sdkModuleContext android.ModuleContext, info * func (info *nativeLibInfo) generatePrebuiltLibrary(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder, member android.SdkMember) { pbm := builder.AddPrebuiltModule(member, info.memberType.prebuiltModuleType) addPossiblyArchSpecificProperties(info.commonProperties, pbm) archProperties := pbm.AddPropertySet("arch") for _, av := range info.archVariantProperties { archTypeProperties := archProperties.AddPropertySet(av.archType) // Add any arch specific properties inside the appropriate arch: {<arch>: {...}} block archTypeProperties.AddProperty("srcs", []string{nativeLibraryPathFor(av)}) addPossiblyArchSpecificProperties(av, archTypeProperties) } pbm.AddProperty("stl", "none") pbm.AddProperty("system_shared_libs", []string{}) } // Add properties that may, or may not, be arch specific. func addPossiblyArchSpecificProperties(libInfo nativeLibInfoProperties, outputProperties android.BpPropertySet) { addExportedDirsForNativeLibs(libInfo, outputProperties, false /*systemInclude*/) addExportedDirsForNativeLibs(libInfo, outputProperties, true /*systemInclude*/) } // a function for emitting include dirs addExportedDirsForNativeLibs := func(lib nativeLibInfoProperties, properties android.BpPropertySet, systemInclude bool) { func addExportedDirsForNativeLibs(lib nativeLibInfoProperties, properties android.BpPropertySet, systemInclude bool) { includeDirs := nativeIncludeDirPathsFor(lib, systemInclude) if len(includeDirs) == 0 { return Loading @@ -256,24 +278,6 @@ func (info *nativeLibInfo) generatePrebuiltLibrary(sdkModuleContext android.Modu properties.AddProperty(propertyName, includeDirs) } pbm := builder.AddPrebuiltModule(member, info.memberType.prebuiltModuleType) addExportedDirsForNativeLibs(info.commonProperties, pbm, false /*systemInclude*/) addExportedDirsForNativeLibs(info.commonProperties, pbm, true /*systemInclude*/) archProperties := pbm.AddPropertySet("arch") for _, av := range info.archVariantProperties { archTypeProperties := archProperties.AddPropertySet(av.archType) archTypeProperties.AddProperty("srcs", []string{nativeLibraryPathFor(av)}) // export_* properties are added inside the arch: {<arch>: {...}} block addExportedDirsForNativeLibs(av, archTypeProperties, false /*systemInclude*/) addExportedDirsForNativeLibs(av, archTypeProperties, true /*systemInclude*/) } pbm.AddProperty("stl", "none") pbm.AddProperty("system_shared_libs", []string{}) } const ( nativeIncludeDir = "include" nativeGeneratedIncludeDir = "include_gen" Loading Loading
cc/library_sdk_member.go +24 −20 Original line number Diff line number Diff line Loading @@ -241,8 +241,30 @@ func buildSharedNativeLibSnapshot(sdkModuleContext android.ModuleContext, info * func (info *nativeLibInfo) generatePrebuiltLibrary(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder, member android.SdkMember) { pbm := builder.AddPrebuiltModule(member, info.memberType.prebuiltModuleType) addPossiblyArchSpecificProperties(info.commonProperties, pbm) archProperties := pbm.AddPropertySet("arch") for _, av := range info.archVariantProperties { archTypeProperties := archProperties.AddPropertySet(av.archType) // Add any arch specific properties inside the appropriate arch: {<arch>: {...}} block archTypeProperties.AddProperty("srcs", []string{nativeLibraryPathFor(av)}) addPossiblyArchSpecificProperties(av, archTypeProperties) } pbm.AddProperty("stl", "none") pbm.AddProperty("system_shared_libs", []string{}) } // Add properties that may, or may not, be arch specific. func addPossiblyArchSpecificProperties(libInfo nativeLibInfoProperties, outputProperties android.BpPropertySet) { addExportedDirsForNativeLibs(libInfo, outputProperties, false /*systemInclude*/) addExportedDirsForNativeLibs(libInfo, outputProperties, true /*systemInclude*/) } // a function for emitting include dirs addExportedDirsForNativeLibs := func(lib nativeLibInfoProperties, properties android.BpPropertySet, systemInclude bool) { func addExportedDirsForNativeLibs(lib nativeLibInfoProperties, properties android.BpPropertySet, systemInclude bool) { includeDirs := nativeIncludeDirPathsFor(lib, systemInclude) if len(includeDirs) == 0 { return Loading @@ -256,24 +278,6 @@ func (info *nativeLibInfo) generatePrebuiltLibrary(sdkModuleContext android.Modu properties.AddProperty(propertyName, includeDirs) } pbm := builder.AddPrebuiltModule(member, info.memberType.prebuiltModuleType) addExportedDirsForNativeLibs(info.commonProperties, pbm, false /*systemInclude*/) addExportedDirsForNativeLibs(info.commonProperties, pbm, true /*systemInclude*/) archProperties := pbm.AddPropertySet("arch") for _, av := range info.archVariantProperties { archTypeProperties := archProperties.AddPropertySet(av.archType) archTypeProperties.AddProperty("srcs", []string{nativeLibraryPathFor(av)}) // export_* properties are added inside the arch: {<arch>: {...}} block addExportedDirsForNativeLibs(av, archTypeProperties, false /*systemInclude*/) addExportedDirsForNativeLibs(av, archTypeProperties, true /*systemInclude*/) } pbm.AddProperty("stl", "none") pbm.AddProperty("system_shared_libs", []string{}) } const ( nativeIncludeDir = "include" nativeGeneratedIncludeDir = "include_gen" Loading