Use version mutator for NDK
The ndk_api mutator is similar to the version mutator. Move the
ndk_library ndk_api variations into the version mutator instead,
which will help later when consolidating the stubs handling
between NDK, LLDNK and Apex libraries.
Test: No change to build.ninja or Android-${TARGET_PRODUCT}.mk
Change-Id: I51417cf669265762c15f7289e1dc186d017ef4a9
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 899d339..e58a172 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -442,6 +442,11 @@
entries.SubName = ndkLibrarySuffix + "." + c.apiLevel.String()
entries.Class = "SHARED_LIBRARIES"
+ if !c.buildStubs() {
+ entries.Disabled = true
+ return
+ }
+
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
path, file := filepath.Split(c.installPath.String())
stem, suffix, _ := android.SplitFileExt(file)