Add __ANDROID_SDK_VERSION__=<ver> macro
sdk_version is passed for relevant variants. If not specified or "current", it maps to "10000" for platform variants, and "min_sdk_version" of the apex for apex variants. Bug: 150860940 Test: m (soong test) manually check build.ninja Change-Id: I5102ab0c5086b5ad29d16ac45af55d32062167b4
This commit is contained in:
@@ -315,6 +315,18 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
||||
"-isystem "+getCurrentIncludePath(ctx).Join(ctx, config.NDKTriple(tc)).String())
|
||||
}
|
||||
|
||||
if ctx.canUseSdk() {
|
||||
sdkVersion := ctx.sdkVersion()
|
||||
if sdkVersion == "" || sdkVersion == "current" {
|
||||
if ctx.isForPlatform() {
|
||||
sdkVersion = strconv.Itoa(android.FutureApiLevel)
|
||||
} else {
|
||||
sdkVersion = strconv.Itoa(ctx.apexSdkVersion())
|
||||
}
|
||||
}
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_SDK_VERSION__="+sdkVersion)
|
||||
}
|
||||
|
||||
if ctx.useVndk() {
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VNDK__")
|
||||
}
|
||||
|
Reference in New Issue
Block a user