diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2022-02-04 14:08:50 -0800 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2022-02-05 13:50:41 -0800 |
commit | d6b0a87ed788842bcc32db6181a11c50e0ca78b5 (patch) | |
tree | 618c2080779cc11e26b58bf1dc6f90ab09e4c12a | |
parent | ee5ceff61e4a7fdcbfdb1c9739b31e8d5a07155c (diff) | |
download | build-d6b0a87ed788842bcc32db6181a11c50e0ca78b5.tar.gz |
Add GLOBAL_CLANG_EXTERNAL_CFLAGS_NO_OVERRIDE to third-party code
Bug: http://b/215753485
This allows enabling a new warning from the compiler update for
first-party code. This is less precise than the check in build/soong
(also overrides for vendor/google, for e.g.) because of being written in
Make.
Test: With new clang, verify the following:
lunch oriole;
m out/target/product/oriole/obj_arm/SHARED_LIBRARIES/libexynosdisplay_intermediates/libresource/ExynosMPP.o
Change-Id: I13080fec71e282c4b528a6d01b967b1c0c4aef02
-rw-r--r-- | core/binary.mk | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/binary.mk b/core/binary.mk index cf47374b5e..94e3a0fecb 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -32,6 +32,12 @@ else endif endif +# Third party code has additional no-override flags. +is_third_party := +ifneq ($(filter external/% hardware/% vendor/%,$(LOCAL_PATH)),) + is_third_party := true +endif + my_soong_problems := # The following LOCAL_ variables will be modified in this file. @@ -48,6 +54,10 @@ my_conlyflags := $(LOCAL_CONLYFLAGS) my_cppflags := $(LOCAL_CPPFLAGS) my_cflags_no_override := $(GLOBAL_CLANG_CFLAGS_NO_OVERRIDE) my_cppflags_no_override := $(GLOBAL_CLANG_CPPFLAGS_NO_OVERRIDE) +ifdef is_third_party + my_cflags_no_override += $(GLOBAL_CLANG_EXTERNAL_CFLAGS_NO_OVERRIDE) + my_cppflags_no_override += $(GLOBAL_CLANG_EXTERNAL_CFLAGS_NO_OVERRIDE) +endif my_ldflags := $(LOCAL_LDFLAGS) my_ldlibs := $(LOCAL_LDLIBS) my_asflags := $(LOCAL_ASFLAGS) |