Pass -I to yasm

external/libvpx needs -I flags to be propagated to yasm, but can't
handle all the other global flags (like -no-exceptions).  Add -I
arguments to YasmFlags as well as GlobalFlags.

Test: mega-device build of external/libvpx
Change-Id: I1607211c34b031fae8ffc1bd558b26019965a696
diff --git a/cc/compiler.go b/cc/compiler.go
index aed4480..a122bbd 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -198,15 +198,20 @@
 	// Include dir cflags
 	localIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs)
 	if len(localIncludeDirs) > 0 {
-		flags.GlobalFlags = append(flags.GlobalFlags, includeDirsToFlags(localIncludeDirs))
+		f := includeDirsToFlags(localIncludeDirs)
+		flags.GlobalFlags = append(flags.GlobalFlags, f)
+		flags.YasmFlags = append(flags.YasmFlags, f)
 	}
 	rootIncludeDirs := android.PathsForSource(ctx, compiler.Properties.Include_dirs)
 	if len(rootIncludeDirs) > 0 {
-		flags.GlobalFlags = append(flags.GlobalFlags, includeDirsToFlags(rootIncludeDirs))
+		f := includeDirsToFlags(rootIncludeDirs)
+		flags.GlobalFlags = append(flags.GlobalFlags, f)
+		flags.YasmFlags = append(flags.YasmFlags, f)
 	}
 
 	if !ctx.noDefaultCompilerFlags() {
 		flags.GlobalFlags = append(flags.GlobalFlags, "-I"+android.PathForModuleSrc(ctx).String())
+		flags.YasmFlags = append(flags.YasmFlags, "-I"+android.PathForModuleSrc(ctx).String())
 
 		if !(ctx.sdk() || ctx.vndk()) || ctx.Host() {
 			flags.SystemIncludeFlags = append(flags.SystemIncludeFlags,
diff --git a/cc/library.go b/cc/library.go
index e2ec584..86e3269 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -306,7 +306,9 @@
 func (library *libraryDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags {
 	exportIncludeDirs := library.flagExporter.exportedIncludes(ctx)
 	if len(exportIncludeDirs) > 0 {
-		flags.GlobalFlags = append(flags.GlobalFlags, includeDirsToFlags(exportIncludeDirs))
+		f := includeDirsToFlags(exportIncludeDirs)
+		flags.GlobalFlags = append(flags.GlobalFlags, f)
+		flags.YasmFlags = append(flags.YasmFlags, f)
 	}
 
 	return library.baseCompiler.compilerFlags(ctx, flags)