Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: build/common.gypi

Issue 437543007: Refactor how clang warning flags are set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index e1c5a3f4ab1300f90b9fd895930ffb09d2fb87e2..4f83f4c400bcc5bcb3ceeea20c7b4ed7f18bb061 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -2400,7 +2400,40 @@
'host_os%': '<(host_os)', # See comment above chromium_code.
}],
],
+ 'clang_warning_flags': [
+ '-Wheader-hygiene',
+
+ # Don't die on dtoa code that uses a char as an array index.
+ # This is required solely for base/third_party/dmg_fp/dtoa.cc.
+ '-Wno-char-subscripts',
+
+ # TODO(thakis): This used to be implied by -Wno-unused-function,
+ # which we no longer use. Check if it makes sense to remove
+ # this as well. http://crbug.com/316352
+ '-Wno-unneeded-internal-declaration',
+
+ # Warns on switches on enums that cover all enum values but
+ # also contain a default: branch. Chrome is full of that.
+ '-Wno-covered-switch-default',
+
+ # Warns when a const char[] is converted to bool.
+ '-Wstring-conversion',
+
+ # C++11-related flags:
+
+ # This warns on using ints as initializers for floats in
+ # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
+ # which happens in several places in chrome code. Not sure if
+ # this is worth fixing.
+ '-Wno-c++11-narrowing',
+
+ # Clang considers the `register` keyword as deprecated, but e.g.
+ # code generated by flex (used in angle) contains that keyword.
+ # http://crbug.com/255186
+ '-Wno-deprecated-register',
+ ],
},
+ 'includes': [ 'set_clang_warning_flags.gypi', ],
'defines': [
# Don't use deprecated V8 APIs anywhere.
'V8_DEPRECATION_WARNINGS',
@@ -2873,18 +2906,7 @@
'defines': ['OS_CHROMEOS=1'],
}],
['enable_wexit_time_destructors==1', {
- 'conditions': [
- [ 'clang==1', {
- 'cflags': [
- '-Wexit-time-destructors',
- ],
- 'xcode_settings': {
- 'WARNING_CFLAGS': [
- '-Wexit-time-destructors',
- ],
- },
- }],
- ],
+ 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
}],
['chromium_code==0', {
'conditions': [
@@ -3865,38 +3887,8 @@
}],
['clang==1', {
'cflags': [
- '-Wheader-hygiene',
-
- # Don't die on dtoa code that uses a char as an array index.
- '-Wno-char-subscripts',
-
- # TODO(thakis): This used to be implied by -Wno-unused-function,
- # which we no longer use. Check if it makes sense to remove
- # this as well. http://crbug.com/316352
- '-Wno-unneeded-internal-declaration',
-
- # Warns on switches on enums that cover all enum values but
- # also contain a default: branch. Chrome is full of that.
- '-Wno-covered-switch-default',
-
- # Warns when a const char[] is converted to bool.
- '-Wstring-conversion',
-
- # C++11-related flags:
-
- # This warns on using ints as initializers for floats in
- # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
- # which happens in several places in chrome code. Not sure if
- # this is worth fixing.
- '-Wno-c++11-narrowing',
-
# TODO(thakis): Remove, http://crbug.com/263960
'-Wno-reserved-user-defined-literal',
-
- # Clang considers the `register` keyword as deprecated, but e.g.
- # code generated by flex (used in angle) contains that keyword.
- # http://crbug.com/255186
- '-Wno-deprecated-register',
],
'cflags_cc': [
# See the comment in the Mac section for what it takes to move
@@ -4675,35 +4667,6 @@
'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'WARNING_CFLAGS': [
- '-Wheader-hygiene',
-
- # This warns on using ints as initializers for floats in
- # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
- # which happens in several places in chrome code. Not sure if
- # this is worth fixing.
- '-Wno-c++11-narrowing',
-
- # Don't die on dtoa code that uses a char as an array index.
- # This is required solely for base/third_party/dmg_fp/dtoa.cc.
- '-Wno-char-subscripts',
-
- # TODO(thakis): This used to be implied by -Wno-unused-function,
- # which we no longer use. Check if it makes sense to remove
- # this as well. http://crbug.com/316352
- '-Wno-unneeded-internal-declaration',
-
- # Warns on switches on enums that cover all enum values but
- # also contain a default: branch. Chrome is full of that.
- '-Wno-covered-switch-default',
-
- # Warns when a const char[] is converted to bool.
- '-Wstring-conversion',
-
- # Clang considers the `register` keyword as deprecated, but
- # e.g. code generated by flex (used in angle) contains that
- # keyword. http://crbug.com/255186
- '-Wno-deprecated-register',
-
# This warns on selectors from Cocoa headers (-length, -set).
# cfe-dev is currently discussing the merits of this warning.
# TODO(thakis): Reevaluate what to do with this, based one

Powered by Google App Engine
This is Rietveld 408576698