Support `sdk_version: "current"` for the NDK.
We need to fall back to the old CRT objects since we aren't generating
those yet.
Test: Created a test module using "current", checked that it linked
the libs from current.
Bug: None
Change-Id: I5fe170d7b26154da8877672ac2acb7da0262fe38
diff --git a/cc/compiler.go b/cc/compiler.go
index c1040dd..1798f4e 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -183,8 +183,12 @@
// Traditionally this has come from android/api-level.h, but with the
// libc headers unified it must be set by the build system since we
// don't have per-API level copies of that header now.
+ version := ctx.sdkVersion()
+ if version == "current" {
+ version = "__ANDROID_API_FUTURE__"
+ }
flags.GlobalFlags = append(flags.GlobalFlags,
- "-D__ANDROID_API__="+ctx.sdkVersion())
+ "-D__ANDROID_API__="+version)
// Until the full NDK has been migrated to using ndk_headers, we still
// need to add the legacy sysroot includes to get the full set of