Don't generate intermediate NDK libraries.
It's better to clip to the existing versions here rather than build
the lower levels as if they existed.
cc.Module's begin() will now normalize the sdk_version to a valid
value for the given architecture so that doesn't have to be checked
later.
Test: make checkbuild with all other libc ndk_library changes
Change-Id: I2fa834f7a1ac3b03a0723291778d86207fcfda72
diff --git a/cc/cc.go b/cc/cc.go
index b381897..6698007 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -491,6 +491,13 @@
for _, feature := range c.features {
feature.begin(ctx)
}
+ if ctx.sdk() {
+ version, err := normalizeNdkApiLevel(ctx.sdkVersion(), ctx.Arch())
+ if err != nil {
+ ctx.PropertyErrorf("sdk_version", err.Error())
+ }
+ c.Properties.Sdk_version = strconv.Itoa(version)
+ }
}
func (c *Module) deps(ctx BaseModuleContext) Deps {