Merge "Copy sdk_version to cc library snapshots"

This commit is contained in:
Paul Duffin 2020-03-09 14:15:54 +00:00 committed by Gerrit Code Review
commit 71754bf640
2 changed files with 10 additions and 0 deletions

View File

@ -97,6 +97,13 @@ func (mt *librarySdkMemberType) IsInstance(module android.Module) bool {
func (mt *librarySdkMemberType) AddPrebuiltModule(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder, member android.SdkMember) android.BpModule {
pbm := builder.AddPrebuiltModule(member, mt.prebuiltModuleType)
ccModule := member.Variants()[0].(*Module)
sdkVersion := ccModule.SdkVersion()
if sdkVersion != "" {
pbm.AddProperty("sdk_version", sdkVersion)
}
return pbm
}

View File

@ -517,6 +517,7 @@ func TestHostSnapshotWithCcSharedLibrary(t *testing.T) {
},
system_shared_libs: [],
stl: "none",
sdk_version: "minimum",
}
`)
@ -529,6 +530,7 @@ cc_prebuilt_library_shared {
sdk_member_name: "mynativelib",
device_supported: false,
host_supported: true,
sdk_version: "minimum",
export_include_dirs: ["include/include"],
arch: {
x86_64: {
@ -549,6 +551,7 @@ cc_prebuilt_library_shared {
prefer: false,
device_supported: false,
host_supported: true,
sdk_version: "minimum",
export_include_dirs: ["include/include"],
arch: {
x86_64: {