Make genrule export_include_dirs more consistent

Previously, genrule export_include_dirs always added ModuleDir to
exported include dirs when export_include_dirs is set but not when
export_include_dirs is not set. Now when export_include_dirs is set, we
also export the directory without the additional ModuleDir subdir.

Test: genrule go tests
Test: set export_include_dirs and test
Change-Id: I46e860b2c20c1a96bddd14367d7fa737d901994d
This commit is contained in:
Liz Kammer
2023-07-17 09:58:50 -04:00
parent 9488eb82d4
commit d38c87c035
2 changed files with 46 additions and 0 deletions

View File

@@ -293,6 +293,9 @@ func (g *Module) generateCommonBuildActions(ctx android.ModuleContext) {
for _, dir := range g.properties.Export_include_dirs {
g.exportedIncludeDirs = append(g.exportedIncludeDirs,
android.PathForModuleGen(ctx, g.subDir, ctx.ModuleDir(), dir))
// Also export without ModuleDir for consistency with Export_include_dirs not being set
g.exportedIncludeDirs = append(g.exportedIncludeDirs,
android.PathForModuleGen(ctx, g.subDir, dir))
}
} else {
g.exportedIncludeDirs = append(g.exportedIncludeDirs, android.PathForModuleGen(ctx, g.subDir))