summaryrefslogtreecommitdiff
path: root/cc/compiler.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/compiler.go')
-rw-r--r--cc/compiler.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/cc/compiler.go b/cc/compiler.go
index fe81bd0a4..681b1ab90 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -315,18 +315,6 @@ 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__")
}
@@ -340,6 +328,9 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
if Bool(compiler.Properties.Use_apex_name_macro) {
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX_"+makeDefineString(ctx.apexName())+"__")
}
+ if ctx.Device() {
+ flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_SDK_VERSION__="+strconv.Itoa(ctx.apexSdkVersion()))
+ }
}
instructionSet := String(compiler.Properties.Instruction_set)