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/library.go b/cc/library.go
index 5fb522a..dff38c8 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -335,8 +335,16 @@
deps.CrtBegin = "crtbegin_so"
deps.CrtEnd = "crtend_so"
} else {
- deps.CrtBegin = "ndk_crtbegin_so." + ctx.sdkVersion()
- deps.CrtEnd = "ndk_crtend_so." + ctx.sdkVersion()
+ // TODO(danalbert): Add generation of crt objects.
+ // For `sdk_version: "current"`, we don't actually have a
+ // freshly generated set of CRT objects. Use the last stable
+ // version.
+ version := ctx.sdkVersion()
+ if version == "current" {
+ version = ctx.AConfig().PlatformSdkVersion()
+ }
+ deps.CrtBegin = "ndk_crtbegin_so." + version
+ deps.CrtEnd = "ndk_crtend_so." + version
}
}
deps.WholeStaticLibs = append(deps.WholeStaticLibs, library.Properties.Shared.Whole_static_libs...)