From 1cfd89aca341fa83a82d8e42f88cd80530953a4b Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 15 Sep 2016 09:30:46 -0700 Subject: [PATCH] Split CommonGlobalIncludes for system includes Split CommonGlobalSystemIncludes out of CommonGlobalIncludes in preparation for moving global includes from -isystem to -I. Bug: 31492149 Change-Id: Ib935ea038cdbf9515dc2ab68d7fff924c370906a --- cc/compiler.go | 1 + cc/config/global.go | 6 ++++-- cc/makevars.go | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cc/compiler.go b/cc/compiler.go index 4a7bba9c8..37dc7449c 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -147,6 +147,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag if !ctx.sdk() || ctx.Host() { flags.GlobalFlags = append(flags.GlobalFlags, "${config.CommonGlobalIncludes}", + "${config.CommonGlobalSystemIncludes}", tc.IncludeFlags(), "${config.CommonNativehelperInclude}") } diff --git a/cc/config/global.go b/cc/config/global.go index f1989a27b..5b49bc3e9 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -90,9 +90,11 @@ func init() { pctx.StaticVariable("CommonClangGlobalCppflags", strings.Join(append(ClangFilterUnknownCflags(commonGlobalCppflags), "${ClangExtraCppflags}"), " ")) - // Everything in this list is a crime against abstraction and dependency tracking. + // Everything in these lists is a crime against abstraction and dependency tracking. // Do not add anything to this list. - pctx.PrefixedPathsForOptionalSourceVariable("CommonGlobalIncludes", "-isystem ", + pctx.PrefixedPathsForOptionalSourceVariable("CommonGlobalIncludes", "-I", + []string{}) + pctx.PrefixedPathsForOptionalSourceVariable("CommonGlobalSystemIncludes", "-isystem ", []string{ "system/core/include", "system/media/audio/include", diff --git a/cc/makevars.go b/cc/makevars.go index b07297d64..ea3212169 100644 --- a/cc/makevars.go +++ b/cc/makevars.go @@ -44,7 +44,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("GLOBAL_CLANG_CPPFLAGS_NO_OVERRIDE", "") ctx.Strict("NDK_PREBUILT_SHARED_LIBRARIES", strings.Join(ndkPrebuiltSharedLibs, " ")) - includeFlags, err := ctx.Eval("${config.CommonGlobalIncludes}") + includeFlags, err := ctx.Eval("${config.CommonGlobalIncludes} ${config.CommonGlobalSystemIncludes}") if err != nil { panic(err) }