Forbid -Weverything
Use of -Weverything blocks build system changes and toolchain updates on new warnings. Forbid it in the build system. Developers can experiment with -Weverything on their module by adding it to their Android.mk file and building with m ANDROID_TEMPORARILY_ALLOW_WEVERYTHING=true Fixes: 143713277 Test: manual Change-Id: Ifca9ad45301b0d51f18b5ae85cfb9e5b89fbef3f
This commit is contained in:
@@ -1441,10 +1441,10 @@ endif
|
|||||||
|
|
||||||
# Check if -Werror or -Wno-error is used in C compiler flags.
|
# Check if -Werror or -Wno-error is used in C compiler flags.
|
||||||
# Header libraries do not need cflags.
|
# Header libraries do not need cflags.
|
||||||
|
my_all_cflags := $(my_cflags) $(my_cppflags) $(my_cflags_no_override)
|
||||||
ifneq (HEADER_LIBRARIES,$(LOCAL_MODULE_CLASS))
|
ifneq (HEADER_LIBRARIES,$(LOCAL_MODULE_CLASS))
|
||||||
# Prebuilt modules do not need cflags.
|
# Prebuilt modules do not need cflags.
|
||||||
ifeq (,$(LOCAL_PREBUILT_MODULE_FILE))
|
ifeq (,$(LOCAL_PREBUILT_MODULE_FILE))
|
||||||
my_all_cflags := $(my_cflags) $(my_cppflags) $(my_cflags_no_override)
|
|
||||||
# Issue warning if -Wno-error is used.
|
# Issue warning if -Wno-error is used.
|
||||||
ifneq (,$(filter -Wno-error,$(my_all_cflags)))
|
ifneq (,$(filter -Wno-error,$(my_all_cflags)))
|
||||||
$(eval MODULES_USING_WNO_ERROR := $(MODULES_USING_WNO_ERROR) $(LOCAL_MODULE_MAKEFILE):$(LOCAL_MODULE))
|
$(eval MODULES_USING_WNO_ERROR := $(MODULES_USING_WNO_ERROR) $(LOCAL_MODULE_MAKEFILE):$(LOCAL_MODULE))
|
||||||
@@ -1463,6 +1463,13 @@ ifneq (HEADER_LIBRARIES,$(LOCAL_MODULE_CLASS))
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter -Weverything,$(my_all_cflags)))
|
||||||
|
ifeq (,$(ANDROID_TEMPORARILY_ALLOW_WEVERYTHING))
|
||||||
|
$(call pretty-error, -Weverything is not allowed in Android.mk files.\
|
||||||
|
Build with `m ANDROID_TEMPORARILY_ALLOW_WEVERYTHING=true` to experiment locally with -Weverything.)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Disable clang-tidy if it is not found.
|
# Disable clang-tidy if it is not found.
|
||||||
ifeq ($(PATH_TO_CLANG_TIDY),)
|
ifeq ($(PATH_TO_CLANG_TIDY),)
|
||||||
my_tidy_enabled := false
|
my_tidy_enabled := false
|
||||||
|
Reference in New Issue
Block a user