Add a preprocessed_ndk_headers module type.

Unlike the old version of this (which has been renamed to
verioned_ndk_headers), this module includes a property to specify the
preprocessor to be used.

This is going to be used for preprocessing ICU4C's unicode/uconfig.h
to alter a config value that needs to differ between the platform and
the NDK.

Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/548
Change-Id: If5c6f54f90cf5a4187693a941748d72f39b0d797
This commit is contained in:
Dan Albert
2018-05-24 15:06:11 -07:00
parent 4972f88699
commit cb1b4b2d53
2 changed files with 97 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ func init() {
android.RegisterModuleType("ndk_headers", ndkHeadersFactory)
android.RegisterModuleType("ndk_library", ndkLibraryFactory)
android.RegisterModuleType("versioned_ndk_headers", versionedNdkHeadersFactory)
android.RegisterModuleType("preprocessed_ndk_headers", preprocessedNdkHeadersFactory)
android.RegisterSingletonType("ndk", NdkSingleton)
pctx.Import("android/soong/common")
@@ -112,6 +113,11 @@ func (n *ndkSingleton) GenerateBuildActions(ctx android.SingletonContext) {
licensePaths = append(licensePaths, m.licensePath)
}
if m, ok := module.(*preprocessedHeadersModule); ok {
installPaths = append(installPaths, m.installPaths...)
licensePaths = append(licensePaths, m.licensePath)
}
if m, ok := module.(*Module); ok {
if installer, ok := m.installer.(*stubDecorator); ok {
installPaths = append(installPaths, installer.installPath)