Export proto deps from reused libraries too
The deps have to be exported alongside the headers to make sure the headers are in place when a module that depends on the shared library builds. Bug: 37555583 Test: use protos in a cc_library Change-Id: I8f5b8d7937868458c1cf02b990a348aa395634da
This commit is contained in:
3
cc/cc.go
3
cc/cc.go
@@ -950,9 +950,10 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
|
|||||||
|
|
||||||
if tag == reuseObjTag {
|
if tag == reuseObjTag {
|
||||||
if l, ok := cc.compiler.(libraryInterface); ok {
|
if l, ok := cc.compiler.(libraryInterface); ok {
|
||||||
objs, flags := l.reuseObjs()
|
objs, flags, deps := l.reuseObjs()
|
||||||
depPaths.Objs = depPaths.Objs.Append(objs)
|
depPaths.Objs = depPaths.Objs.Append(objs)
|
||||||
depPaths.ReexportedFlags = append(depPaths.ReexportedFlags, flags...)
|
depPaths.ReexportedFlags = append(depPaths.ReexportedFlags, flags...)
|
||||||
|
depPaths.ReexportedFlagsDeps = append(depPaths.ReexportedFlagsDeps, deps...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -202,6 +202,7 @@ type libraryDecorator struct {
|
|||||||
// For reusing static library objects for shared library
|
// For reusing static library objects for shared library
|
||||||
reuseObjects Objects
|
reuseObjects Objects
|
||||||
reuseExportedFlags []string
|
reuseExportedFlags []string
|
||||||
|
reuseExportedDeps android.Paths
|
||||||
|
|
||||||
// table-of-contents file to optimize out relinking when possible
|
// table-of-contents file to optimize out relinking when possible
|
||||||
tocFile android.OptionalPath
|
tocFile android.OptionalPath
|
||||||
@@ -364,7 +365,7 @@ type libraryInterface interface {
|
|||||||
getWholeStaticMissingDeps() []string
|
getWholeStaticMissingDeps() []string
|
||||||
static() bool
|
static() bool
|
||||||
objs() Objects
|
objs() Objects
|
||||||
reuseObjs() (Objects, []string)
|
reuseObjs() (Objects, []string, android.Paths)
|
||||||
toc() android.OptionalPath
|
toc() android.OptionalPath
|
||||||
|
|
||||||
// Returns true if the build options for the module have selected a static or shared build
|
// Returns true if the build options for the module have selected a static or shared build
|
||||||
@@ -623,6 +624,7 @@ func (library *libraryDecorator) link(ctx ModuleContext,
|
|||||||
library.reexportFlags(flags)
|
library.reexportFlags(flags)
|
||||||
library.reuseExportedFlags = append(library.reuseExportedFlags, flags...)
|
library.reuseExportedFlags = append(library.reuseExportedFlags, flags...)
|
||||||
library.reexportDeps(library.baseCompiler.deps) // TODO: restrict to aidl deps
|
library.reexportDeps(library.baseCompiler.deps) // TODO: restrict to aidl deps
|
||||||
|
library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.deps...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -635,6 +637,7 @@ func (library *libraryDecorator) link(ctx ModuleContext,
|
|||||||
library.reexportFlags(flags)
|
library.reexportFlags(flags)
|
||||||
library.reuseExportedFlags = append(library.reuseExportedFlags, flags...)
|
library.reuseExportedFlags = append(library.reuseExportedFlags, flags...)
|
||||||
library.reexportDeps(library.baseCompiler.deps) // TODO: restrict to proto deps
|
library.reexportDeps(library.baseCompiler.deps) // TODO: restrict to proto deps
|
||||||
|
library.reuseExportedDeps = append(library.reuseExportedDeps, library.baseCompiler.deps...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -659,8 +662,8 @@ func (library *libraryDecorator) objs() Objects {
|
|||||||
return library.objects
|
return library.objects
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *libraryDecorator) reuseObjs() (Objects, []string) {
|
func (library *libraryDecorator) reuseObjs() (Objects, []string, android.Paths) {
|
||||||
return library.reuseObjects, library.reuseExportedFlags
|
return library.reuseObjects, library.reuseExportedFlags, library.reuseExportedDeps
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *libraryDecorator) toc() android.OptionalPath {
|
func (library *libraryDecorator) toc() android.OptionalPath {
|
||||||
|
Reference in New Issue
Block a user