Merge "Use vndk snapshot libraries txt files if exist" into main
This commit is contained in:
25
cc/vndk.go
25
cc/vndk.go
@@ -41,6 +41,16 @@ const (
|
|||||||
|
|
||||||
func VndkLibrariesTxtModules(vndkVersion string, ctx android.BaseModuleContext) []string {
|
func VndkLibrariesTxtModules(vndkVersion string, ctx android.BaseModuleContext) []string {
|
||||||
if vndkVersion == "current" {
|
if vndkVersion == "current" {
|
||||||
|
// We can assume all txt files are snapshotted if we find one of them.
|
||||||
|
currentVndkSnapshotted := ctx.OtherModuleExists(insertVndkVersion(llndkLibrariesTxt, ctx.DeviceConfig().PlatformVndkVersion()))
|
||||||
|
if currentVndkSnapshotted {
|
||||||
|
// If the current VNDK is already snapshotted (which can happen with
|
||||||
|
// the `next` config), use the prebuilt txt files in the snapshot.
|
||||||
|
// This is because the txt files built from source are probably be
|
||||||
|
// for the in-development version.
|
||||||
|
vndkVersion = ctx.DeviceConfig().PlatformVndkVersion()
|
||||||
|
} else {
|
||||||
|
// Use the txt files generated from the source
|
||||||
result := []string{
|
result := []string{
|
||||||
vndkCoreLibrariesTxt,
|
vndkCoreLibrariesTxt,
|
||||||
vndkSpLibrariesTxt,
|
vndkSpLibrariesTxt,
|
||||||
@@ -48,14 +58,16 @@ func VndkLibrariesTxtModules(vndkVersion string, ctx android.BaseModuleContext)
|
|||||||
vndkProductLibrariesTxt,
|
vndkProductLibrariesTxt,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(b/290159430) This part will not be required once deprecation of VNDK
|
// TODO(b/290159430) This part will not be required once deprecation
|
||||||
// is handled with 'ro.vndk.version' property
|
// of VNDK is handled with 'ro.vndk.version' property
|
||||||
if !ctx.Config().IsVndkDeprecated() {
|
if !ctx.Config().IsVndkDeprecated() {
|
||||||
result = append(result, llndkLibrariesTxt)
|
result = append(result, llndkLibrariesTxt)
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Snapshot vndks have their own *.libraries.VER.txt files.
|
// Snapshot vndks have their own *.libraries.VER.txt files.
|
||||||
// Note that snapshots don't have "vndkcorevariant.libraries.VER.txt"
|
// Note that snapshots don't have "vndkcorevariant.libraries.VER.txt"
|
||||||
result := []string{
|
result := []string{
|
||||||
@@ -535,6 +547,15 @@ func insertVndkVersion(filename string, vndkVersion string) string {
|
|||||||
return filename
|
return filename
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (txt *vndkLibrariesTxt) DepsMutator(mctx android.BottomUpMutatorContext) {
|
||||||
|
versionedName := insertVndkVersion(txt.Name(), mctx.DeviceConfig().PlatformVndkVersion())
|
||||||
|
if mctx.OtherModuleExists(versionedName) {
|
||||||
|
// If the prebuilt vndk libraries txt files exist, install them instead.
|
||||||
|
txt.HideFromMake()
|
||||||
|
mctx.AddDependency(txt, nil, versionedName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (txt *vndkLibrariesTxt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (txt *vndkLibrariesTxt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
filename := txt.Name()
|
filename := txt.Name()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user