Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index 708e12c2aa3f6ae9ff536f5c7a71f33ca6d4f34f..a7fbba9f8ebfaaa7f3ef62fc145e39a1c760dc94 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -346,6 +346,10 @@ |
# by the GYP command line or by ~/.gyp/include.gypi. |
'component%': 'static_library', |
+ # /analyze is off by default on Windows because it is very slow and noisy. |
+ # Enable with GYP_DEFINES=win_analyze=1 |
+ 'win_analyze%': 0, |
+ |
# Set to select the Title Case versions of strings in GRD files. |
'use_titlecase_in_grd%': 0, |
@@ -1108,6 +1112,7 @@ |
'chroot_cmd%': '<(chroot_cmd)', |
'system_libdir%': '<(system_libdir)', |
'component%': '<(component)', |
+ 'win_analyze%': '<(win_analyze)', |
'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)', |
'use_titlecase_in_grd%': '<(use_titlecase_in_grd)', |
'use_third_party_translations%': '<(use_third_party_translations)', |
@@ -2804,8 +2809,42 @@ |
'DebugInformationFormat': '1', |
} |
} |
- }], |
- ], # win_z7!=0 |
+ }], # win_z7!=0 |
+ ['win_analyze', { |
+ 'defines!': [ |
+ # This is prohibited when running /analyze. |
+ '_USING_V110_SDK71_', |
+ ], |
+ 'msvs_settings': { |
+ 'VCCLCompilerTool': { |
+ # Set WarnAsError to false to disable this setting for most |
+ # projects so that compilation continues. |
+ 'WarnAsError': 'false', |
+ # When win_analyze is specified add the /analyze switch. |
+ # Also add /WX- to force-disable WarnAsError for projects that |
+ # override WarnAsError. |
+ # Also, disable various noisy warnings that have low value. |
+ 'AdditionalOptions': [ |
+ '/analyze', |
+ '/WX-', |
+ '/wd6011', # Dereferencing NULL pointer |
+ '/wd6312', # Possible infinite loop: use of the constant |
+ # EXCEPTION_CONTINUE_EXECUTION in the exception-filter |
+ '/wd6326', # Potential comparison of constant with constant |
+ '/wd28159', # Consider using 'GetTickCount64' |
+ '/wd28204', # Inconsistent SAL annotations |
+ '/wd28251', # Inconsistent SAL annotations |
+ '/wd28252', # Inconsistent SAL annotations |
+ '/wd28253', # Inconsistent SAL annotations |
+ '/wd28196', # The precondition is not satisfied |
+ '/wd28301', # Inconsistent SAL annotations |
+ '/wd6340', # Sign mismatch in function parameter |
+ '/wd28182', # Dereferencing NULL pointer |
+ ], |
+ }, |
+ }, |
+ }], # win_analyze |
+ ], |
}], # OS==win |
['chromecast==1', { |
'defines': [ |