Remove global include paths for modules built against NDK

Modules built against the NDK shouldn't get the global or arch-specific
include paths, all headers will be provided by depenendencies or the
NDK.

Change-Id: I13b9530a365e11e9cf6bd2b99b756b36944e0a9e
This commit is contained in:
Colin Cross
2015-04-21 17:38:44 -07:00
parent 41c187b3d4
commit 56b4d45341

View File

@@ -451,7 +451,7 @@ func (c *ccBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
common.ModuleGenDir(ctx),
}...)
if c.properties.Sdk_version == "" {
if c.properties.Sdk_version == "" || ctx.Host() {
flags.IncludeDirs = append(flags.IncludeDirs, "${SrcDir}/libnativehelper/include/nativehelper")
}
@@ -459,26 +459,26 @@ func (c *ccBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
flags.LdFlags = append(flags.LdFlags, "-Wl,--no-undefined")
}
if ctx.Host() || c.properties.Sdk_version == "" {
flags.GlobalFlags = append(flags.GlobalFlags,
"${commonGlobalIncludes}",
toolchain.IncludeFlags())
}
flags.GlobalFlags = append(flags.GlobalFlags, instructionSetFlags)
if flags.Clang {
flags.CppFlags = append(flags.CppFlags, "${commonClangGlobalCppflags}")
flags.GlobalFlags = []string{
"${commonGlobalIncludes}",
toolchain.IncludeFlags(),
instructionSetFlags,
flags.GlobalFlags = append(flags.GlobalFlags,
toolchain.ClangCflags(),
"${commonClangGlobalCflags}",
fmt.Sprintf("${%sClangGlobalCflags}", ctx.Arch().HostOrDevice),
}
fmt.Sprintf("${%sClangGlobalCflags}", ctx.Arch().HostOrDevice))
} else {
flags.CppFlags = append(flags.CppFlags, "${commonGlobalCppflags}")
flags.GlobalFlags = []string{
"${commonGlobalIncludes}",
toolchain.IncludeFlags(),
instructionSetFlags,
flags.GlobalFlags = append(flags.GlobalFlags,
toolchain.Cflags(),
"${commonGlobalCflags}",
fmt.Sprintf("${%sGlobalCflags}", ctx.Arch().HostOrDevice),
}
fmt.Sprintf("${%sGlobalCflags}", ctx.Arch().HostOrDevice))
}
if ctx.Host() {