Ensure consistent handling of generated headers/dirs
The list of exported generated headers are all expected to be within
one of the exported generated include dirs. Previously, that was not
the case as ExportedGeneratedIncludeDirs was suitable for extracting
to common properties (which changes the output location) and
exportedGeneratedHeaders was not.
This would cause a problem if there was only one variant. In that case
the ExportedGeneratedIncludeDirs would be treated as a common property
and placed in include_gen/<x> directory while exportedGeneratedHeaders
would be treated as an arch specific property and placed in
<arch>/include_gen/<x>.
Bug: 142935992
Test: m nothing
Change-Id: Idf82a5ca551b44ec31971c7ff3bd957a4c38f396
diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go
index 165901d..dd097cf 100644
--- a/cc/library_sdk_member.go
+++ b/cc/library_sdk_member.go
@@ -115,7 +115,7 @@
name: memberName,
archType: ccModule.Target().Arch.ArchType.String(),
ExportedIncludeDirs: exportedIncludeDirs,
- ExportedGeneratedIncludeDirs: exportedGeneratedIncludeDirs,
+ exportedGeneratedIncludeDirs: exportedGeneratedIncludeDirs,
ExportedSystemIncludeDirs: ccModule.ExportedSystemIncludeDirs(),
ExportedFlags: ccModule.ExportedFlags(),
exportedGeneratedHeaders: ccModule.ExportedGeneratedHeaders(),
@@ -200,7 +200,7 @@
func buildSharedNativeLibSnapshot(sdkModuleContext android.ModuleContext, info *nativeLibInfo, builder android.SnapshotBuilder, member android.SdkMember) {
// a function for emitting include dirs
addExportedDirCopyCommandsForNativeLibs := func(lib nativeLibInfoProperties) {
- // Do not include ExportedGeneratedIncludeDirs in the list of directories whose
+ // Do not include exportedGeneratedIncludeDirs in the list of directories whose
// contents are copied as they are copied from exportedGeneratedHeaders below.
includeDirs := lib.ExportedIncludeDirs
includeDirs = append(includeDirs, lib.ExportedSystemIncludeDirs...)
@@ -296,7 +296,7 @@
var includeDirs []android.Path
if !systemInclude {
// Include the generated include dirs in the exported include dirs.
- includeDirs = append(lib.ExportedIncludeDirs, lib.ExportedGeneratedIncludeDirs...)
+ includeDirs = append(lib.ExportedIncludeDirs, lib.exportedGeneratedIncludeDirs...)
} else {
includeDirs = lib.ExportedSystemIncludeDirs
}
@@ -327,14 +327,31 @@
// This is "" for common properties.
archType string
- ExportedIncludeDirs android.Paths
- ExportedGeneratedIncludeDirs android.Paths
- ExportedSystemIncludeDirs android.Paths
- ExportedFlags []string
+ // The list of possibly common exported include dirs.
+ //
+ // This field is exported as its contents may not be arch specific.
+ ExportedIncludeDirs android.Paths
- // exportedGeneratedHeaders is not exported as if set it is always arch specific.
+ // The list of arch specific exported generated include dirs.
+ //
+ // This field is not exported as its contents are always arch specific.
+ exportedGeneratedIncludeDirs android.Paths
+
+ // The list of arch specific exported generated header files.
+ //
+ // This field is not exported as its contents are is always arch specific.
exportedGeneratedHeaders android.Paths
+ // The list of possibly common exported system include dirs.
+ //
+ // This field is exported as its contents may not be arch specific.
+ ExportedSystemIncludeDirs android.Paths
+
+ // The list of possibly common exported flags.
+ //
+ // This field is exported as its contents may not be arch specific.
+ ExportedFlags []string
+
// outputFile is not exported as it is always arch specific.
outputFile android.Path
}