Issue warning on projects with LOCAL_CLANG set to false.
* LOCAL_CLANG_EXCEPTION_PROJECTS is the list of project prefixes.
* New warning message is detected by warn.py as high severity.
Bug: 30575506
Change-Id: I87a38b2ba6bab1d2e5e7a9d5ec9557f0e609727c
Test: build and find new warning in build.log
diff --git a/core/clang/config.mk b/core/clang/config.mk
index 4685514..e47c36a 100644
--- a/core/clang/config.mk
+++ b/core/clang/config.mk
@@ -143,4 +143,21 @@
FORCE_BUILD_LLVM_COMPONENTS := true
endif
+# A list of projects that are allowed to set LOCAL_CLANG to false.
+LOCAL_CLANG_EXCEPTION_PROJECTS := \
+ device/huawei/angler/ \
+ device/lge/bullhead/ \
+ external/valgrind/ \
+ hardware/qcom/ \
+ $(INTERNAL_LOCAL_CLANG_EXCEPTION_PROJECTS)
+
+# Find $1 in the exception project list.
+define find_in_local_clang_exception_projects
+$(subst $(space),, \
+ $(foreach project,$(LOCAL_CLANG_EXCEPTION_PROJECTS), \
+ $(if $(filter $(project)%,$(1)),$(project)) \
+ ) \
+)
+endef
+
include $(BUILD_SYSTEM)/clang/tidy.mk