Support reexporting vndk from vendor snapshot
Bug: 184795475 Test: soong test Change-Id: I0146de55e2ef54c1c8abd42f0f4d8b4db7444350
This commit is contained in:
parent
f7aadf70d8
commit
dd0295d774
|
@ -559,10 +559,18 @@ func (p *snapshotLibraryDecorator) link(ctx ModuleContext, flags Flags, deps Pat
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Flags specified directly to this module.
|
||||||
p.libraryDecorator.reexportDirs(android.PathsForModuleSrc(ctx, p.properties.Export_include_dirs)...)
|
p.libraryDecorator.reexportDirs(android.PathsForModuleSrc(ctx, p.properties.Export_include_dirs)...)
|
||||||
p.libraryDecorator.reexportSystemDirs(android.PathsForModuleSrc(ctx, p.properties.Export_system_include_dirs)...)
|
p.libraryDecorator.reexportSystemDirs(android.PathsForModuleSrc(ctx, p.properties.Export_system_include_dirs)...)
|
||||||
p.libraryDecorator.reexportFlags(p.properties.Export_flags...)
|
p.libraryDecorator.reexportFlags(p.properties.Export_flags...)
|
||||||
|
|
||||||
|
// Flags reexported from dependencies. (e.g. vndk_prebuilt_shared)
|
||||||
|
p.libraryDecorator.reexportDirs(deps.ReexportedDirs...)
|
||||||
|
p.libraryDecorator.reexportSystemDirs(deps.ReexportedSystemDirs...)
|
||||||
|
p.libraryDecorator.reexportFlags(deps.ReexportedFlags...)
|
||||||
|
p.libraryDecorator.reexportDeps(deps.ReexportedDeps...)
|
||||||
|
p.libraryDecorator.addExportedGeneratedHeaders(deps.ReexportedGeneratedHeaders...)
|
||||||
|
|
||||||
in := android.PathForModuleSrc(ctx, *p.properties.Src)
|
in := android.PathForModuleSrc(ctx, *p.properties.Src)
|
||||||
p.unstrippedOutputFile = in
|
p.unstrippedOutputFile = in
|
||||||
|
|
||||||
|
|
|
@ -506,13 +506,13 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||||
arch: {
|
arch: {
|
||||||
arm64: {
|
arm64: {
|
||||||
src: "libvndk.a",
|
src: "libvndk.a",
|
||||||
export_include_dirs: ["include/libvndk"],
|
|
||||||
},
|
},
|
||||||
arm: {
|
arm: {
|
||||||
src: "libvndk.a",
|
src: "libvndk.a",
|
||||||
export_include_dirs: ["include/libvndk"],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
shared_libs: ["libvndk"],
|
||||||
|
export_shared_lib_headers: ["libvndk"],
|
||||||
}
|
}
|
||||||
|
|
||||||
vendor_snapshot_shared {
|
vendor_snapshot_shared {
|
||||||
|
@ -848,9 +848,9 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||||
t.Errorf("libflags for libclientCfi must contain %#v, but was %#v", libvendorCfiOutputPaths[0], libclientCfiLdFlags)
|
t.Errorf("libflags for libclientCfi must contain %#v, but was %#v", libvendorCfiOutputPaths[0], libclientCfiLdFlags)
|
||||||
}
|
}
|
||||||
|
|
||||||
// bin_without_snapshot uses libvndk.vendor_static.30.arm64
|
// bin_without_snapshot uses libvndk.vendor_static.30.arm64 (which reexports vndk's exported headers)
|
||||||
binWithoutSnapshotCcFlags := ctx.ModuleForTests("bin_without_snapshot", binaryVariant).Rule("cc").Args["cFlags"]
|
binWithoutSnapshotCcFlags := ctx.ModuleForTests("bin_without_snapshot", binaryVariant).Rule("cc").Args["cFlags"]
|
||||||
if !strings.Contains(binWithoutSnapshotCcFlags, "-Ivendor/include/libvndk") {
|
if !strings.Contains(binWithoutSnapshotCcFlags, "-Ivndk/include/libvndk") {
|
||||||
t.Errorf("flags for bin_without_snapshot must contain %#v, but was %#v.",
|
t.Errorf("flags for bin_without_snapshot must contain %#v, but was %#v.",
|
||||||
"-Ivendor/include/libvndk", binWithoutSnapshotCcFlags)
|
"-Ivendor/include/libvndk", binWithoutSnapshotCcFlags)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue