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
This commit is contained in:
Colin Cross 2017-04-26 14:55:27 -07:00
parent 0906f17f7e
commit dad8c954b2
2 changed files with 10 additions and 3 deletions

View file

@ -198,15 +198,20 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag
// 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,

View file

@ -306,7 +306,9 @@ func (library *libraryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Fla
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)