Add export_include_dirs to the local include path

Bug: 32641232
Test: ./soong builds compared before/after
Change-Id: If417a9f2278f42ffa524fccfd34f2b01a8cc9fb5
diff --git a/cc/compiler.go b/cc/compiler.go
index 7e79dfa..c1040dd 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -150,11 +150,14 @@
 	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() {