Add cc_prebuilt_library_headers

In preparation for adding cc_library_headers support to
sdk/module_exports.

Two changes were needed to make the prebuilt version work.
1) Had to stop the prebuilt version of the library from creating static
   and shared variants for header only.
2) Had to allow the code to export/reexport include dirs to run even
   when no src is provided.

Bug: 148933848
Test: m nothing
Change-Id: Idd50ed38bc90d1d93551f78e6310f167941487d9
This commit is contained in:
Paul Duffin
2020-02-21 10:57:00 +00:00
parent 1c6c1c7251
commit f5ea9e1f76
4 changed files with 56 additions and 20 deletions

View File

@@ -87,15 +87,16 @@ func (p *prebuiltLibraryLinker) linkerProps() []interface{} {
func (p *prebuiltLibraryLinker) link(ctx ModuleContext,
flags Flags, deps PathDeps, objs Objects) android.Path {
p.libraryDecorator.exportIncludes(ctx)
p.libraryDecorator.reexportDirs(deps.ReexportedDirs...)
p.libraryDecorator.reexportSystemDirs(deps.ReexportedSystemDirs...)
p.libraryDecorator.reexportFlags(deps.ReexportedFlags...)
p.libraryDecorator.reexportDeps(deps.ReexportedDeps...)
p.libraryDecorator.addExportedGeneratedHeaders(deps.ReexportedGeneratedHeaders...)
// TODO(ccross): verify shared library dependencies
if len(p.properties.Srcs) > 0 {
p.libraryDecorator.exportIncludes(ctx)
p.libraryDecorator.reexportDirs(deps.ReexportedDirs...)
p.libraryDecorator.reexportSystemDirs(deps.ReexportedSystemDirs...)
p.libraryDecorator.reexportFlags(deps.ReexportedFlags...)
p.libraryDecorator.reexportDeps(deps.ReexportedDeps...)
p.libraryDecorator.addExportedGeneratedHeaders(deps.ReexportedGeneratedHeaders...)
builderFlags := flagsToBuilderFlags(flags)
in := p.Prebuilt.SingleSourcePath(ctx)