aboutsummaryrefslogtreecommitdiffstats
path: root/cc/compiler.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-11-03 15:53:42 -0700
committerDan Willemsen <dwillemsen@google.com>2016-11-07 22:31:32 +0000
commit273af7f3aa02615a4b57e95bc06bcfd2953c3360 (patch)
tree6b940205bdb27572150578871bd7b2111fb767eb /cc/compiler.go
parenta5662d5e4ef7bc2cc63a5c3c123e29c93956686c (diff)
downloadbuild_soong-273af7f3aa02615a4b57e95bc06bcfd2953c3360.tar.gz
build_soong-273af7f3aa02615a4b57e95bc06bcfd2953c3360.tar.bz2
build_soong-273af7f3aa02615a4b57e95bc06bcfd2953c3360.zip
Add export_include_dirs to the local include path
Bug: 32641232 Test: ./soong builds compared before/after Change-Id: If417a9f2278f42ffa524fccfd34f2b01a8cc9fb5
Diffstat (limited to 'cc/compiler.go')
-rw-r--r--cc/compiler.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/cc/compiler.go b/cc/compiler.go
index 7e79dfa0..c1040dd0 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -150,11 +150,14 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag
flags.YaccFlags = append(flags.YaccFlags, esc(compiler.Properties.Yaccflags)...)
// Include dir cflags
- rootIncludeDirs := android.PathsForSource(ctx, compiler.Properties.Include_dirs)
localIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs)
- flags.GlobalFlags = append(flags.GlobalFlags,
- includeDirsToFlags(localIncludeDirs),
- includeDirsToFlags(rootIncludeDirs))
+ if len(localIncludeDirs) > 0 {
+ flags.GlobalFlags = append(flags.GlobalFlags, includeDirsToFlags(localIncludeDirs))
+ }
+ rootIncludeDirs := android.PathsForSource(ctx, compiler.Properties.Include_dirs)
+ if len(rootIncludeDirs) > 0 {
+ flags.GlobalFlags = append(flags.GlobalFlags, includeDirsToFlags(rootIncludeDirs))
+ }
if !ctx.noDefaultCompilerFlags() {
if !ctx.sdk() || ctx.Host() {