Add preprocessed_ndk_headers.
Prototypes in the bionic headers are annotated with `__INTRODUCED_IN`
tags that are processed by bionic/tools/versioner into their usable
form (tags replaced with `#if __ANDROID_API__ >= foo` guards). We've
previously done this as a periodic manual step with the results
checked in to prebuilts/ndk, but that's been a huge hassle for me.
Make the tool a part of the build instead.
Test: make checkbuild
Bug: http://b/35673791
Change-Id: I2f5c1aeae239ac4ab6616eb5c71360e3055f86d5
diff --git a/cc/ndk_sysroot.go b/cc/ndk_sysroot.go
index e82f12b..47dda27 100644
--- a/cc/ndk_sysroot.go
+++ b/cc/ndk_sysroot.go
@@ -61,6 +61,7 @@
func init() {
android.RegisterModuleType("ndk_headers", ndkHeadersFactory)
android.RegisterModuleType("ndk_library", ndkLibraryFactory)
+ android.RegisterModuleType("preprocessed_ndk_headers", preprocessedNdkHeadersFactory)
android.RegisterSingletonType("ndk", NdkSingleton)
pctx.Import("android/soong/common")
@@ -93,9 +94,12 @@
installPaths = append(installPaths, m.installPaths...)
licensePaths = append(licensePaths, m.licensePath.String())
}
- })
- ctx.VisitAllModules(func(module blueprint.Module) {
+ if m, ok := module.(*preprocessedHeaderModule); ok {
+ installPaths = append(installPaths, m.installPaths...)
+ licensePaths = append(licensePaths, m.licensePath.String())
+ }
+
if m, ok := module.(*Module); ok {
if installer, ok := m.installer.(*stubDecorator); ok {
installPaths = append(installPaths, installer.installPath)