Merge "Only export sysprop headers in exported sysprop include directory" am: 1dd5764a4e am: e2db082638 am: 28a690d283

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1596831

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I06da8ac9ac32f5a16eedc0245ec94bb45dad5d96
This commit is contained in:
Paul Duffin 2021-02-24 02:17:19 +00:00 committed by Automerger Merge Worker
commit 73a7d9be76
2 changed files with 7 additions and 4 deletions

View File

@ -4154,8 +4154,6 @@ func TestIncludeDirsExporting(t *testing.T) {
)
})
// TODO fix this test as it exports the sysprop public and non-public headers irrespective of
// which include directory is exported.
t.Run("ensure only sysprop headers are exported", func(t *testing.T) {
ctx := testCc(t, genRuleModules+`
cc_library_shared {
@ -4176,7 +4174,6 @@ func TestIncludeDirsExporting(t *testing.T) {
expectedSystemIncludeDirs(``),
expectedGeneratedHeaders(`
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/sysprop/include/a.sysprop.h
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/sysprop/public/include/a.sysprop.h
`),
expectedOrderOnlyDeps(`
.intermediates/libfoo/android_arm64_armv8-a_shared/gen/sysprop/include/a.sysprop.h

View File

@ -1348,10 +1348,16 @@ func (library *libraryDecorator) link(ctx ModuleContext,
}
}
// Make sure to only export headers which are within the include directory.
_, headers := android.FilterPathListPredicate(library.baseCompiler.syspropHeaders, func(path android.Path) bool {
_, isRel := android.MaybeRel(ctx, dir.String(), path.String())
return isRel
})
// Add sysprop-related directories to the exported directories of this library.
library.reexportDirs(dir)
library.reexportDeps(library.baseCompiler.syspropOrderOnlyDeps...)
library.addExportedGeneratedHeaders(library.baseCompiler.syspropHeaders...)
library.addExportedGeneratedHeaders(headers...)
}
// Add stub-related flags if this library is a stub library.