Add default -Wall -Werror or -Wall.
* Skip Android.bp, prebuilt, and HEADER_LIBRARIES targets.
* If neither -Wno-error nor -Werror is used, add default -Wall -Werror.
However, if the build target is in a project
under one of ANDROID_WARNING_ALLOWED_PROJECTS, add only -Wall.
* Dump name of modules using -Wno-error or added -Wall -Werror
into file $(PRODUCT_OUT)/wall_werror.txt.
Bug: 66996870
Test: normal build
Change-Id: Ief8cf776e8613ed073a64dd271534688845d5c2c
diff --git a/core/config.mk b/core/config.mk
index debe918..e0ad1d9 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -893,38 +893,7 @@
APPS_DEFAULT_VERSION_NAME := $(PLATFORM_VERSION)
endif
-# Projects clean of compiler warnings should be compiled with -Werror.
-# If most modules in a directory such as external/ have warnings,
-# the directory should be in ANDROID_WARNING_ALLOWED_PROJECTS list.
-# When some of its subdirectories are cleaned up, the subdirectories
-# can be added into ANDROID_WARNING_DISALLOWED_PROJECTS list, e.g.
-# external/fio/.
-ANDROID_WARNING_DISALLOWED_PROJECTS := \
- art/% \
- bionic/% \
- external/fio/% \
- hardware/interfaces/% \
-
-define find_warning_disallowed_projects
- $(filter $(ANDROID_WARNING_DISALLOWED_PROJECTS),$(1)/)
-endef
-
-# Projects with compiler warnings are compiled without -Werror.
-ANDROID_WARNING_ALLOWED_PROJECTS := \
- bootable/% \
- cts/% \
- dalvik/% \
- development/% \
- device/% \
- external/% \
- frameworks/% \
- hardware/% \
- packages/% \
- system/% \
- test/vts/% \
- tools/adt/idea/android/ultimate/get_modification_time/jni/% \
- vendor/% \
-
+# ANDROID_WARNING_ALLOWED_PROJECTS is generated by build/soong.
define find_warning_allowed_projects
$(filter $(ANDROID_WARNING_ALLOWED_PROJECTS),$(1)/)
endef