Merge "Allow cc modules to pull in rust includes." am: 36396b26ef
am: b6eddf33c0
Change-Id: I0ef88334341a279f3d6c6edc620b636491addb05
This commit is contained in:
5
cc/cc.go
5
cc/cc.go
@@ -509,7 +509,7 @@ func (c *Module) SdkVersion() string {
|
|||||||
return String(c.Properties.Sdk_version)
|
return String(c.Properties.Sdk_version)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Module) IncludeDirs(ctx android.BaseModuleContext) android.Paths {
|
func (c *Module) IncludeDirs() android.Paths {
|
||||||
if c.linker != nil {
|
if c.linker != nil {
|
||||||
if library, ok := c.linker.(exportedFlagsProducer); ok {
|
if library, ok := c.linker.(exportedFlagsProducer); ok {
|
||||||
return library.exportedDirs()
|
return library.exportedDirs()
|
||||||
@@ -2040,10 +2040,11 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
depPaths.IncludeDirs = append(depPaths.IncludeDirs, ccDep.IncludeDirs()...)
|
||||||
|
|
||||||
// Exporting flags only makes sense for cc.Modules
|
// Exporting flags only makes sense for cc.Modules
|
||||||
if _, ok := ccDep.(*Module); ok {
|
if _, ok := ccDep.(*Module); ok {
|
||||||
if i, ok := ccDep.(*Module).linker.(exportedFlagsProducer); ok {
|
if i, ok := ccDep.(*Module).linker.(exportedFlagsProducer); ok {
|
||||||
depPaths.IncludeDirs = append(depPaths.IncludeDirs, i.exportedDirs()...)
|
|
||||||
depPaths.SystemIncludeDirs = append(depPaths.SystemIncludeDirs, i.exportedSystemDirs()...)
|
depPaths.SystemIncludeDirs = append(depPaths.SystemIncludeDirs, i.exportedSystemDirs()...)
|
||||||
depPaths.GeneratedHeaders = append(depPaths.GeneratedHeaders, i.exportedDeps()...)
|
depPaths.GeneratedHeaders = append(depPaths.GeneratedHeaders, i.exportedDeps()...)
|
||||||
depPaths.Flags = append(depPaths.Flags, i.exportedFlags()...)
|
depPaths.Flags = append(depPaths.Flags, i.exportedFlags()...)
|
||||||
|
@@ -13,7 +13,7 @@ type LinkableInterface interface {
|
|||||||
|
|
||||||
OutputFile() android.OptionalPath
|
OutputFile() android.OptionalPath
|
||||||
|
|
||||||
IncludeDirs(ctx android.BaseModuleContext) android.Paths
|
IncludeDirs() android.Paths
|
||||||
SetDepsInLinkOrder([]android.Path)
|
SetDepsInLinkOrder([]android.Path)
|
||||||
GetDepsInLinkOrder() []android.Path
|
GetDepsInLinkOrder() []android.Path
|
||||||
|
|
||||||
|
@@ -78,6 +78,7 @@ type libraryDecorator struct {
|
|||||||
MutatedProperties LibraryMutatedProperties
|
MutatedProperties LibraryMutatedProperties
|
||||||
distFile android.OptionalPath
|
distFile android.OptionalPath
|
||||||
unstrippedOutputFile android.Path
|
unstrippedOutputFile android.Path
|
||||||
|
includeDirs android.Paths
|
||||||
}
|
}
|
||||||
|
|
||||||
type libraryInterface interface {
|
type libraryInterface interface {
|
||||||
@@ -311,6 +312,13 @@ func (library *libraryDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
|
|||||||
|
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
func (library *libraryDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
|
flags = library.baseCompiler.compilerFlags(ctx, flags)
|
||||||
|
if library.shared() || library.static() {
|
||||||
|
library.includeDirs = append(library.includeDirs, android.PathsForModuleSrc(ctx, library.Properties.Include_dirs)...)
|
||||||
|
}
|
||||||
|
return flags
|
||||||
|
}
|
||||||
|
|
||||||
func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Path {
|
func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Path {
|
||||||
var outputFile android.WritablePath
|
var outputFile android.WritablePath
|
||||||
|
@@ -246,10 +246,10 @@ func (mod *Module) CcLibraryInterface() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mod *Module) IncludeDirs(ctx android.BaseModuleContext) android.Paths {
|
func (mod *Module) IncludeDirs() android.Paths {
|
||||||
if mod.compiler != nil {
|
if mod.compiler != nil {
|
||||||
if library, ok := mod.compiler.(*libraryDecorator); ok {
|
if library, ok := mod.compiler.(*libraryDecorator); ok {
|
||||||
return android.PathsForSource(ctx, library.Properties.Include_dirs)
|
return library.includeDirs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panic(fmt.Errorf("IncludeDirs called on non-library module: %q", mod.BaseModuleName()))
|
panic(fmt.Errorf("IncludeDirs called on non-library module: %q", mod.BaseModuleName()))
|
||||||
|
Reference in New Issue
Block a user