Revert "Revert "Add external projects only CFlags option""
This reverts commit a9ccbb7b87b9f7f30e38f1f79c1de064ffbcc392.
Test: m
Change-Id: I92d7b7707f73ef3af5824d3e8cb6da0465b5e07d
diff --git a/cc/compiler.go b/cc/compiler.go
index 8f119cf..10cec8c 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -392,6 +392,12 @@
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")