summaryrefslogtreecommitdiff
path: root/cc/compiler.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/compiler.go')
-rw-r--r--cc/compiler.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cc/compiler.go b/cc/compiler.go
index 3730bbe66..949603e40 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -324,6 +324,10 @@ func addToModuleList(ctx ModuleContext, key android.OnceKey, module string) {
getNamedMapForConfig(ctx.Config(), key).Store(module, true)
}
+func requiresGlobalIncludes(ctx ModuleContext) bool {
+ return !(ctx.useSdk() || ctx.InVendorOrProduct()) || ctx.Host()
+}
+
func useGnuExtensions(gnuExtensions *bool) bool {
return proptools.BoolDefault(gnuExtensions, true)
}
@@ -452,7 +456,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
flags.Local.YasmFlags = append(flags.Local.YasmFlags, "-I"+modulePath)
}
- if !(ctx.useSdk() || ctx.InVendorOrProduct()) || ctx.Host() {
+ if requiresGlobalIncludes(ctx) {
flags.SystemIncludeFlags = append(flags.SystemIncludeFlags,
"${config.CommonGlobalIncludes}",
tc.IncludeFlags())