Allow cc modules to pull in rust includes.
Make sure LinkabeInterfaces can export include dirs to cc modules. This
fixes the Rust implementation and makes sure these are pulled in for cc
modules.
Bug: 144052093
Test: cc module depending on a rust library includes dirs correctly.
Change-Id: I6b5d5e6ab6afb507178b4f2cbdc45f01031dbfe4
diff --git a/cc/cc.go b/cc/cc.go
index 5dfc563..e890aa0 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -501,7 +501,7 @@
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 library, ok := c.linker.(exportedFlagsProducer); ok {
return library.exportedDirs()
@@ -2027,10 +2027,11 @@
}
}
+ depPaths.IncludeDirs = append(depPaths.IncludeDirs, ccDep.IncludeDirs()...)
+
// Exporting flags only makes sense for cc.Modules
if _, ok := ccDep.(*Module); ok {
if i, ok := ccDep.(*Module).linker.(exportedFlagsProducer); ok {
- depPaths.IncludeDirs = append(depPaths.IncludeDirs, i.exportedDirs()...)
depPaths.SystemIncludeDirs = append(depPaths.SystemIncludeDirs, i.exportedSystemDirs()...)
depPaths.GeneratedHeaders = append(depPaths.GeneratedHeaders, i.exportedDeps()...)
depPaths.Flags = append(depPaths.Flags, i.exportedFlags()...)
diff --git a/cc/linkable.go b/cc/linkable.go
index cfbaffe..2efefea 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -13,7 +13,7 @@
OutputFile() android.OptionalPath
- IncludeDirs(ctx android.BaseModuleContext) android.Paths
+ IncludeDirs() android.Paths
SetDepsInLinkOrder([]android.Path)
GetDepsInLinkOrder() []android.Path