Merge "Add flag to disable source directory includes."

am: 3adf8b05f5

Change-Id: I5b79bbc90bd889701e0f3f55dcc7be9df62dec17
This commit is contained in:
Dan Albert
2018-12-07 16:41:43 -08:00
committed by android-build-merger

View File

@@ -75,6 +75,10 @@ type BaseCompilerProperties struct {
// be added to the include path using -I // be added to the include path using -I
Local_include_dirs []string `android:"arch_variant,variant_prepend"` Local_include_dirs []string `android:"arch_variant,variant_prepend"`
// Add the directory containing the Android.bp file to the list of include
// directories. Defaults to true.
Include_build_directory *bool
// list of generated sources to compile. These are the names of gensrcs or // list of generated sources to compile. These are the names of gensrcs or
// genrule modules. // genrule modules.
Generated_sources []string `android:"arch_variant"` Generated_sources []string `android:"arch_variant"`
@@ -288,8 +292,11 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
flags.YasmFlags = append(flags.YasmFlags, f) flags.YasmFlags = append(flags.YasmFlags, f)
} }
flags.GlobalFlags = append(flags.GlobalFlags, "-I"+android.PathForModuleSrc(ctx).String()) if compiler.Properties.Include_build_directory == nil ||
flags.YasmFlags = append(flags.YasmFlags, "-I"+android.PathForModuleSrc(ctx).String()) *compiler.Properties.Include_build_directory {
flags.GlobalFlags = append(flags.GlobalFlags, "-I"+android.PathForModuleSrc(ctx).String())
flags.YasmFlags = append(flags.YasmFlags, "-I"+android.PathForModuleSrc(ctx).String())
}
if !(ctx.useSdk() || ctx.useVndk()) || ctx.Host() { if !(ctx.useSdk() || ctx.useVndk()) || ctx.Host() {
flags.SystemIncludeFlags = append(flags.SystemIncludeFlags, flags.SystemIncludeFlags = append(flags.SystemIncludeFlags,