Merge "Revert "Revert "Add external projects only CFlags option"""
This commit is contained in:
@@ -392,6 +392,12 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
|||||||
fmt.Sprintf("${config.%sGlobalCflags}", hod))
|
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 ctx.Device() {
|
||||||
if Bool(compiler.Properties.Rtti) {
|
if Bool(compiler.Properties.Rtti) {
|
||||||
flags.CppFlags = append(flags.CppFlags, "-frtti")
|
flags.CppFlags = append(flags.CppFlags, "-frtti")
|
||||||
|
@@ -182,6 +182,11 @@ func init() {
|
|||||||
// compatibility.
|
// compatibility.
|
||||||
"-Wno-c++98-compat-extra-semi",
|
"-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 {
|
func ClangFilterUnknownCflags(cflags []string) []string {
|
||||||
|
@@ -170,6 +170,8 @@ func init() {
|
|||||||
pctx.StaticVariable("CommonClangGlobalCppflags",
|
pctx.StaticVariable("CommonClangGlobalCppflags",
|
||||||
strings.Join(append(ClangFilterUnknownCflags(commonGlobalCppflags), "${ClangExtraCppflags}"), " "))
|
strings.Join(append(ClangFilterUnknownCflags(commonGlobalCppflags), "${ClangExtraCppflags}"), " "))
|
||||||
|
|
||||||
|
pctx.StaticVariable("ClangExternalCflags", "${ClangExtraExternalCflags}")
|
||||||
|
|
||||||
// Everything in these lists 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.
|
// Do not add anything to this list.
|
||||||
pctx.PrefixedExistentPathsForSourcesVariable("CommonGlobalIncludes", "-I",
|
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_AS", "${config.RSLLVMPrebuiltsPath}/llvm-as")
|
||||||
ctx.Strict("RS_LLVM_LINK", "${config.RSLLVMPrebuiltsPath}/llvm-link")
|
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_CFLAGS_NO_OVERRIDE", "${config.NoOverrideGlobalCflags}")
|
||||||
ctx.Strict("GLOBAL_CLANG_CFLAGS_NO_OVERRIDE", "${config.ClangExtraNoOverrideCflags}")
|
ctx.Strict("GLOBAL_CLANG_CFLAGS_NO_OVERRIDE", "${config.ClangExtraNoOverrideCflags}")
|
||||||
ctx.Strict("GLOBAL_CPPFLAGS_NO_OVERRIDE", "")
|
ctx.Strict("GLOBAL_CPPFLAGS_NO_OVERRIDE", "")
|
||||||
|
Reference in New Issue
Block a user