Merge "Revert "Revert "Add external projects only CFlags option"""
am: 8d29e1e024
Change-Id: I8806ce876fe68ab36e79e36318af0740b3a9b4c8
This commit is contained in:
commit
2090540f19
|
@ -392,6 +392,12 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
|||
fmt.Sprintf("${config.%sGlobalCflags}", hod))
|
||||
}
|
||||
|
||||
if flags.Clang {
|
||||
if strings.HasPrefix(android.PathForModuleSrc(ctx).String(), "external/") {
|
||||
flags.GlobalFlags = append([]string{"${config.ClangExternalCflags}"}, flags.GlobalFlags...)
|
||||
}
|
||||
}
|
||||
|
||||
if ctx.Device() {
|
||||
if Bool(compiler.Properties.Rtti) {
|
||||
flags.CppFlags = append(flags.CppFlags, "-frtti")
|
||||
|
|
|
@ -182,6 +182,11 @@ func init() {
|
|||
// compatibility.
|
||||
"-Wno-c++98-compat-extra-semi",
|
||||
}, " "))
|
||||
|
||||
// Extra cflags for projects under external/ directory
|
||||
pctx.StaticVariable("ClangExtraExternalCflags", strings.Join([]string{
|
||||
// TODO(yikong): Move -Wno flags here
|
||||
}, " "))
|
||||
}
|
||||
|
||||
func ClangFilterUnknownCflags(cflags []string) []string {
|
||||
|
|
|
@ -170,6 +170,8 @@ func init() {
|
|||
pctx.StaticVariable("CommonClangGlobalCppflags",
|
||||
strings.Join(append(ClangFilterUnknownCflags(commonGlobalCppflags), "${ClangExtraCppflags}"), " "))
|
||||
|
||||
pctx.StaticVariable("ClangExternalCflags", "${ClangExtraExternalCflags}")
|
||||
|
||||
// Everything in these lists is a crime against abstraction and dependency tracking.
|
||||
// Do not add anything to this list.
|
||||
pctx.PrefixedExistentPathsForSourcesVariable("CommonGlobalIncludes", "-I",
|
||||
|
|
|
@ -83,6 +83,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
|
|||
ctx.Strict("RS_LLVM_AS", "${config.RSLLVMPrebuiltsPath}/llvm-as")
|
||||
ctx.Strict("RS_LLVM_LINK", "${config.RSLLVMPrebuiltsPath}/llvm-link")
|
||||
|
||||
ctx.Strict("CLANG_EXTERNAL_CFLAGS", "${config.ClangExternalCflags}")
|
||||
ctx.Strict("GLOBAL_CFLAGS_NO_OVERRIDE", "${config.NoOverrideGlobalCflags}")
|
||||
ctx.Strict("GLOBAL_CLANG_CFLAGS_NO_OVERRIDE", "${config.ClangExtraNoOverrideCflags}")
|
||||
ctx.Strict("GLOBAL_CPPFLAGS_NO_OVERRIDE", "")
|
||||
|
|
Loading…
Reference in New Issue