Merge changes from topic "min_sdk_version"

* changes:
  Versioned CRT objects are built with correct __ANDROID_API__
  Always respect min_sdk_version
This commit is contained in:
Treehugger Robot
2021-03-26 08:07:28 +00:00
committed by Gerrit Code Review
6 changed files with 91 additions and 7 deletions

View File

@@ -414,12 +414,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
target := "-target " + tc.ClangTriple()
if ctx.Os().Class == android.Device {
// When built for the non-updateble part of platform, minSdkVersion doesn't matter.
// It matters only when building we are building for modules that can be unbundled.
version := "current"
if !ctx.isForPlatform() || ctx.isSdkVariant() {
version = ctx.minSdkVersion()
}
version := ctx.minSdkVersion()
if version == "" || version == "current" {
target += strconv.Itoa(android.FutureApiLevelInt)
} else {