From ed9f868f494df2176e953ac825db7213a18a9f0d Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 18 Mar 2015 17:17:35 -0700 Subject: [PATCH] Fix exported include dirs Exported include dirs were only being copied to the build flags in ccDynamic. Move the copy to after collectDeps is run so it picks up the extra includes from all the overriden functions. Also check exported include dirs of shared library dependencies of static libraries. Change-Id: Idb94277f88bbb10869e72011113df57f586274de --- cc/cc.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cc/cc.go b/cc/cc.go index f76706b87..d27bdd0d3 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -313,6 +313,8 @@ func (c *ccBase) GenerateAndroidBuildActions(ctx common.AndroidModuleContext) { return } + flags.includeDirs = append(flags.includeDirs, deps.includeDirs...) + objFiles := c.compileObjs(ctx, flags, deps) if ctx.Failed() { return @@ -798,8 +800,6 @@ func (c *ccDynamic) collectDeps(ctx common.AndroidModuleContext, flags ccFlags) } }) - flags.includeDirs = append(flags.includeDirs, deps.includeDirs...) - return deps, flags } @@ -877,6 +877,11 @@ func (c *ccLibrary) collectDeps(ctx common.AndroidModuleContext, flags ccFlags) } } + // Collect exported includes from shared lib dependencies + sharedLibNames := c.properties.Shared_libs + _, _, newIncludeDirs := c.collectDepsFromList(ctx, sharedLibNames) + deps.includeDirs = append(deps.includeDirs, newIncludeDirs...) + return deps, flags } else if c.libraryProperties.IsShared { return c.ccDynamic.collectDeps(ctx, flags)