Add "WITH_SYNTAX_CHECK=1 make ..."
The new option WITH_SYNTAX_CHECK=1 instructs build system to invoke
"clang -fsyntax-only" to utilize clang's better diagnostics before calling
LOCAL_CC/LOCAL_CXX for code generation. The compilation time is slightly
longer, and the generated object file should be the same as w/o WITH_SYNTAX_CHECK
Project use lots of GCC extensions (eg. nested function) not supported
by clang may opt out by adding LOCAL_NO_SYNTAX_CHECK:=true
Change-Id: Iaeedd07d5719f9df9675ab57e307e28a9c855c1b
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 4333c96..ce5162e 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -141,6 +141,7 @@
LOCAL_DIST_BUNDLED_BINARIES:=
LOCAL_HAL_STATIC_LIBRARIES:=
LOCAL_RMTYPEDEFS:=
+LOCAL_NO_SYNTAX_CHECK:=
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
# iterate over thousands of entries every time.