Merge "Move checking of minApiForArch for apex into cc"
This commit is contained in:
@@ -20,7 +20,7 @@ import (
|
||||
"android/soong/android"
|
||||
)
|
||||
|
||||
func MinApiForArch(ctx android.EarlyModuleContext,
|
||||
func minApiForArch(ctx android.EarlyModuleContext,
|
||||
arch android.ArchType) android.ApiLevel {
|
||||
|
||||
switch arch {
|
||||
@@ -38,7 +38,7 @@ func MinApiForArch(ctx android.EarlyModuleContext,
|
||||
func nativeApiLevelFromUser(ctx android.BaseModuleContext,
|
||||
raw string) (android.ApiLevel, error) {
|
||||
|
||||
min := MinApiForArch(ctx, ctx.Arch().ArchType)
|
||||
min := minApiForArch(ctx, ctx.Arch().ArchType)
|
||||
if raw == "minimum" {
|
||||
return min, nil
|
||||
}
|
||||
|
10
cc/cc.go
10
cc/cc.go
@@ -3626,6 +3626,16 @@ func (c *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext,
|
||||
return err
|
||||
}
|
||||
|
||||
// A dependency only needs to support a min_sdk_version at least
|
||||
// as high as the api level that the architecture was introduced in.
|
||||
// This allows introducing new architectures in the platform that
|
||||
// need to be included in apexes that normally require an older
|
||||
// min_sdk_version.
|
||||
minApiForArch := minApiForArch(ctx, c.Target().Arch.ArchType)
|
||||
if sdkVersion.LessThan(minApiForArch) {
|
||||
sdkVersion = minApiForArch
|
||||
}
|
||||
|
||||
if ver.GreaterThan(sdkVersion) {
|
||||
return fmt.Errorf("newer SDK(%v)", ver)
|
||||
}
|
||||
|
Reference in New Issue
Block a user