Merge changes from topic "vendor_snapshot-192647618" am: da70df7277
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1755250 Change-Id: I1d13f3729a3815d6e97ca40186600b43bbc6f4a2
This commit is contained in:
12
cc/cc.go
12
cc/cc.go
@@ -2014,9 +2014,9 @@ func AddSharedLibDependenciesWithVersions(ctx android.BottomUpMutatorContext, mo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetSnapshot(c LinkableInterface, snapshotInfo **SnapshotInfo, actx android.BottomUpMutatorContext) SnapshotInfo {
|
func GetSnapshot(c LinkableInterface, snapshotInfo **SnapshotInfo, actx android.BottomUpMutatorContext) SnapshotInfo {
|
||||||
// Only modules with BOARD_VNDK_VERSION uses snapshot. Others use the zero value of
|
// Only device modules with BOARD_VNDK_VERSION uses snapshot. Others use the zero value of
|
||||||
// SnapshotInfo, which provides no mappings.
|
// SnapshotInfo, which provides no mappings.
|
||||||
if *snapshotInfo == nil {
|
if *snapshotInfo == nil && c.Device() {
|
||||||
// Only retrieve the snapshot on demand in order to avoid circular dependencies
|
// Only retrieve the snapshot on demand in order to avoid circular dependencies
|
||||||
// between the modules in the snapshot and the snapshot itself.
|
// between the modules in the snapshot and the snapshot itself.
|
||||||
var snapshotModule []blueprint.Module
|
var snapshotModule []blueprint.Module
|
||||||
@@ -2025,16 +2025,16 @@ func GetSnapshot(c LinkableInterface, snapshotInfo **SnapshotInfo, actx android.
|
|||||||
} else if recoverySnapshotVersion := actx.DeviceConfig().RecoverySnapshotVersion(); recoverySnapshotVersion != "current" && recoverySnapshotVersion != "" && c.InRecovery() {
|
} else if recoverySnapshotVersion := actx.DeviceConfig().RecoverySnapshotVersion(); recoverySnapshotVersion != "current" && recoverySnapshotVersion != "" && c.InRecovery() {
|
||||||
snapshotModule = actx.AddVariationDependencies(nil, nil, "recovery_snapshot")
|
snapshotModule = actx.AddVariationDependencies(nil, nil, "recovery_snapshot")
|
||||||
}
|
}
|
||||||
if len(snapshotModule) > 0 {
|
if len(snapshotModule) > 0 && snapshotModule[0] != nil {
|
||||||
snapshot := actx.OtherModuleProvider(snapshotModule[0], SnapshotInfoProvider).(SnapshotInfo)
|
snapshot := actx.OtherModuleProvider(snapshotModule[0], SnapshotInfoProvider).(SnapshotInfo)
|
||||||
*snapshotInfo = &snapshot
|
*snapshotInfo = &snapshot
|
||||||
// republish the snapshot for use in later mutators on this module
|
// republish the snapshot for use in later mutators on this module
|
||||||
actx.SetProvider(SnapshotInfoProvider, snapshot)
|
actx.SetProvider(SnapshotInfoProvider, snapshot)
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
if *snapshotInfo == nil {
|
||||||
*snapshotInfo = &SnapshotInfo{}
|
*snapshotInfo = &SnapshotInfo{}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return **snapshotInfo
|
return **snapshotInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -125,6 +125,7 @@ type LinkableInterface interface {
|
|||||||
IsPrebuilt() bool
|
IsPrebuilt() bool
|
||||||
Toc() android.OptionalPath
|
Toc() android.OptionalPath
|
||||||
|
|
||||||
|
Device() bool
|
||||||
Host() bool
|
Host() bool
|
||||||
|
|
||||||
InRamdisk() bool
|
InRamdisk() bool
|
||||||
|
Reference in New Issue
Block a user