diff options
Diffstat (limited to 'cc/library.go')
-rw-r--r-- | cc/library.go | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/cc/library.go b/cc/library.go index d9754df99..5b2480906 100644 --- a/cc/library.go +++ b/cc/library.go @@ -294,6 +294,10 @@ func (f *flagExporter) exportedIncludes(ctx ModuleContext) android.Paths { return android.PathsForModuleSrc(ctx, f.Properties.Export_include_dirs) } +func (f *flagExporter) exportedSystemIncludes(ctx ModuleContext) android.Paths { + return android.PathsForModuleSrc(ctx, f.Properties.Export_system_include_dirs) +} + // exportIncludes registers the include directories and system include directories to be exported // transitively to modules depending on this module. func (f *flagExporter) exportIncludes(ctx ModuleContext) { @@ -1204,12 +1208,22 @@ func (library *libraryDecorator) coverageOutputFilePath() android.OptionalPath { func (library *libraryDecorator) exportedIncludeDirsForAbiCheck(ctx ModuleContext) []string { exportIncludeDirs := library.flagExporter.exportedIncludes(ctx).Strings() exportIncludeDirs = append(exportIncludeDirs, library.sabi.Properties.ReexportedIncludes...) - return exportIncludeDirs + exportSystemIncludeDirs := library.flagExporter.exportedSystemIncludes(ctx).Strings() + exportSystemIncludeDirs = append(exportSystemIncludeDirs, library.sabi.Properties.ReexportedSystemIncludes...) + // The ABI checker does not distinguish normal and system headers. + return append(exportIncludeDirs, exportSystemIncludeDirs...) } func (library *libraryDecorator) llndkIncludeDirsForAbiCheck(ctx ModuleContext, deps PathDeps) []string { + var includeDirs, systemIncludeDirs []string + // The ABI checker does not need the preprocess which adds macro guards to function declarations. - includeDirs := android.PathsForModuleSrc(ctx, library.Properties.Llndk.Export_preprocessed_headers).Strings() + preprocessedDirs := android.PathsForModuleSrc(ctx, library.Properties.Llndk.Export_preprocessed_headers).Strings() + if Bool(library.Properties.Llndk.Export_headers_as_system) { + systemIncludeDirs = append(systemIncludeDirs, preprocessedDirs...) + } else { + includeDirs = append(includeDirs, preprocessedDirs...) + } if library.Properties.Llndk.Override_export_include_dirs != nil { includeDirs = append(includeDirs, android.PathsForModuleSrc( @@ -1220,7 +1234,8 @@ func (library *libraryDecorator) llndkIncludeDirsForAbiCheck(ctx ModuleContext, // LLNDK does not reexport the implementation's dependencies, such as export_header_libs. } - systemIncludeDirs := []string{} + systemIncludeDirs = append(systemIncludeDirs, + library.flagExporter.exportedSystemIncludes(ctx).Strings()...) if Bool(library.Properties.Llndk.Export_headers_as_system) { systemIncludeDirs = append(systemIncludeDirs, includeDirs...) includeDirs = nil |