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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # IMPORTANT: 5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium, 6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion. 7 # since gyp_chromium is automatically forcing its inclusion.
8 { 8 {
9 # Variables expected to be overriden on the GYP command line (-D) or by 9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi. 10 # ~/.gyp/include.gypi.
(...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after
2393 'mac_debug_optimization%': '0', # Use -O0 unless overridden 2393 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2394 }, { 2394 }, {
2395 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.htm l 2395 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.htm l
2396 'mac_release_optimization%': '3', # Use -O3 unless overridden 2396 'mac_release_optimization%': '3', # Use -O3 unless overridden
2397 'mac_debug_optimization%': '0', # Use -O0 unless overridden 2397 'mac_debug_optimization%': '0', # Use -O0 unless overridden
2398 }], 2398 }],
2399 ['OS=="android"', { 2399 ['OS=="android"', {
2400 'host_os%': '<(host_os)', # See comment above chromium_code. 2400 'host_os%': '<(host_os)', # See comment above chromium_code.
2401 }], 2401 }],
2402 ], 2402 ],
2403 'clang_warning_flags': [
2404 '-Wheader-hygiene',
2405
2406 # Don't die on dtoa code that uses a char as an array index.
2407 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
2408 '-Wno-char-subscripts',
2409
2410 # TODO(thakis): This used to be implied by -Wno-unused-function,
2411 # which we no longer use. Check if it makes sense to remove
2412 # this as well. http://crbug.com/316352
2413 '-Wno-unneeded-internal-declaration',
2414
2415 # Warns on switches on enums that cover all enum values but
2416 # also contain a default: branch. Chrome is full of that.
2417 '-Wno-covered-switch-default',
2418
2419 # Warns when a const char[] is converted to bool.
2420 '-Wstring-conversion',
2421
2422 # C++11-related flags:
2423
2424 # This warns on using ints as initializers for floats in
2425 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
2426 # which happens in several places in chrome code. Not sure if
2427 # this is worth fixing.
2428 '-Wno-c++11-narrowing',
2429
2430 # Clang considers the `register` keyword as deprecated, but e.g.
2431 # code generated by flex (used in angle) contains that keyword.
2432 # http://crbug.com/255186
2433 '-Wno-deprecated-register',
2434 ],
2403 }, 2435 },
2436 'includes': [ 'set_clang_warning_flags.gypi', ],
2404 'defines': [ 2437 'defines': [
2405 # Don't use deprecated V8 APIs anywhere. 2438 # Don't use deprecated V8 APIs anywhere.
2406 'V8_DEPRECATION_WARNINGS', 2439 'V8_DEPRECATION_WARNINGS',
2407 # Temporary suppression until Blink code can be removed. 2440 # Temporary suppression until Blink code can be removed.
2408 'BLINK_SCALE_FILTERS_AT_RECORD_TIME', 2441 'BLINK_SCALE_FILTERS_AT_RECORD_TIME',
2409 ], 2442 ],
2410 'include_dirs': [ 2443 'include_dirs': [
2411 '<(SHARED_INTERMEDIATE_DIR)', 2444 '<(SHARED_INTERMEDIATE_DIR)',
2412 ], 2445 ],
2413 'conditions': [ 2446 'conditions': [
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 'USE_OPENSSL_CERTS=1', 2899 'USE_OPENSSL_CERTS=1',
2867 ], 2900 ],
2868 }], 2901 }],
2869 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', { 2902 ['<(use_nss)==1 and >(nacl_untrusted_build)==0', {
2870 'defines': ['USE_NSS=1'], 2903 'defines': ['USE_NSS=1'],
2871 }], 2904 }],
2872 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', { 2905 ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
2873 'defines': ['OS_CHROMEOS=1'], 2906 'defines': ['OS_CHROMEOS=1'],
2874 }], 2907 }],
2875 ['enable_wexit_time_destructors==1', { 2908 ['enable_wexit_time_destructors==1', {
2876 'conditions': [ 2909 'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
2877 [ 'clang==1', {
2878 'cflags': [
2879 '-Wexit-time-destructors',
2880 ],
2881 'xcode_settings': {
2882 'WARNING_CFLAGS': [
2883 '-Wexit-time-destructors',
2884 ],
2885 },
2886 }],
2887 ],
2888 }], 2910 }],
2889 ['chromium_code==0', { 2911 ['chromium_code==0', {
2890 'conditions': [ 2912 'conditions': [
2891 [ 'os_posix==1 and OS!="mac" and OS!="ios"', { 2913 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
2892 # We don't want to get warnings from third-party code, 2914 # We don't want to get warnings from third-party code,
2893 # so remove any existing warning-enabling flags like -Wall. 2915 # so remove any existing warning-enabling flags like -Wall.
2894 'cflags!': [ 2916 'cflags!': [
2895 '-Wall', 2917 '-Wall',
2896 '-Wextra', 2918 '-Wextra',
2897 ], 2919 ],
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
3858 '--sysroot=<(sysroot)', 3880 '--sysroot=<(sysroot)',
3859 ], 3881 ],
3860 'ldflags': [ 3882 'ldflags': [
3861 '--sysroot=<(sysroot)', 3883 '--sysroot=<(sysroot)',
3862 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))', 3884 '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
3863 ], 3885 ],
3864 }]] 3886 }]]
3865 }], 3887 }],
3866 ['clang==1', { 3888 ['clang==1', {
3867 'cflags': [ 3889 'cflags': [
3868 '-Wheader-hygiene',
3869
3870 # Don't die on dtoa code that uses a char as an array index.
3871 '-Wno-char-subscripts',
3872
3873 # TODO(thakis): This used to be implied by -Wno-unused-function,
3874 # which we no longer use. Check if it makes sense to remove
3875 # this as well. http://crbug.com/316352
3876 '-Wno-unneeded-internal-declaration',
3877
3878 # Warns on switches on enums that cover all enum values but
3879 # also contain a default: branch. Chrome is full of that.
3880 '-Wno-covered-switch-default',
3881
3882 # Warns when a const char[] is converted to bool.
3883 '-Wstring-conversion',
3884
3885 # C++11-related flags:
3886
3887 # This warns on using ints as initializers for floats in
3888 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
3889 # which happens in several places in chrome code. Not sure if
3890 # this is worth fixing.
3891 '-Wno-c++11-narrowing',
3892
3893 # TODO(thakis): Remove, http://crbug.com/263960 3890 # TODO(thakis): Remove, http://crbug.com/263960
3894 '-Wno-reserved-user-defined-literal', 3891 '-Wno-reserved-user-defined-literal',
3895
3896 # Clang considers the `register` keyword as deprecated, but e.g.
3897 # code generated by flex (used in angle) contains that keyword.
3898 # http://crbug.com/255186
3899 '-Wno-deprecated-register',
3900 ], 3892 ],
3901 'cflags_cc': [ 3893 'cflags_cc': [
3902 # See the comment in the Mac section for what it takes to move 3894 # See the comment in the Mac section for what it takes to move
3903 # this to -std=c++11. 3895 # this to -std=c++11.
3904 '-std=gnu++11', 3896 '-std=gnu++11',
3905 ], 3897 ],
3906 }], 3898 }],
3907 ['clang==1 and clang_use_chrome_plugins==1', { 3899 ['clang==1 and clang_use_chrome_plugins==1', {
3908 'cflags': [ 3900 'cflags': [
3909 '<@(clang_chrome_plugins_flags)', 3901 '<@(clang_chrome_plugins_flags)',
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
4668 # typeof() (a GNU extension). 4660 # typeof() (a GNU extension).
4669 # TODO(thakis): Eventually switch this to c++11 instead of 4661 # TODO(thakis): Eventually switch this to c++11 instead of
4670 # gnu++11 (once typeof can be removed, which is blocked on c++11 4662 # gnu++11 (once typeof can be removed, which is blocked on c++11
4671 # being available everywhere). 4663 # being available everywhere).
4672 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11 4664 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', # -std=gnu++11
4673 # Warn if automatic synthesis is triggered with 4665 # Warn if automatic synthesis is triggered with
4674 # the -Wobjc-missing-property-synthesis flag. 4666 # the -Wobjc-missing-property-synthesis flag.
4675 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES', 4667 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4676 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', 4668 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4677 'WARNING_CFLAGS': [ 4669 'WARNING_CFLAGS': [
4678 '-Wheader-hygiene',
4679
4680 # This warns on using ints as initializers for floats in
4681 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
4682 # which happens in several places in chrome code. Not sure if
4683 # this is worth fixing.
4684 '-Wno-c++11-narrowing',
4685
4686 # Don't die on dtoa code that uses a char as an array index.
4687 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
4688 '-Wno-char-subscripts',
4689
4690 # TODO(thakis): This used to be implied by -Wno-unused-function,
4691 # which we no longer use. Check if it makes sense to remove
4692 # this as well. http://crbug.com/316352
4693 '-Wno-unneeded-internal-declaration',
4694
4695 # Warns on switches on enums that cover all enum values but
4696 # also contain a default: branch. Chrome is full of that.
4697 '-Wno-covered-switch-default',
4698
4699 # Warns when a const char[] is converted to bool.
4700 '-Wstring-conversion',
4701
4702 # Clang considers the `register` keyword as deprecated, but
4703 # e.g. code generated by flex (used in angle) contains that
4704 # keyword. http://crbug.com/255186
4705 '-Wno-deprecated-register',
4706
4707 # This warns on selectors from Cocoa headers (-length, -set). 4670 # This warns on selectors from Cocoa headers (-length, -set).
4708 # cfe-dev is currently discussing the merits of this warning. 4671 # cfe-dev is currently discussing the merits of this warning.
4709 # TODO(thakis): Reevaluate what to do with this, based one 4672 # TODO(thakis): Reevaluate what to do with this, based one
4710 # cfe-dev discussion. 4673 # cfe-dev discussion.
4711 '-Wno-selector-type-mismatch', 4674 '-Wno-selector-type-mismatch',
4712 ], 4675 ],
4713 'OTHER_CFLAGS': [ 4676 'OTHER_CFLAGS': [
4714 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed 4677 # TODO(thakis): Remove once http://llvm.org/PR20354 is fixed
4715 # and the fix is in chromium. 4678 # and the fix is in chromium.
4716 '-fno-slp-vectorize', 4679 '-fno-slp-vectorize',
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
5668 # settings in target dicts. SYMROOT is a special case, because many other 5631 # settings in target dicts. SYMROOT is a special case, because many other
5669 # Xcode variables depend on it, including variables such as 5632 # Xcode variables depend on it, including variables such as
5670 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 5633 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5671 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 5634 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5672 # files to appear (when present) in the UI as actual files and not red 5635 # files to appear (when present) in the UI as actual files and not red
5673 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 5636 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5674 # and therefore SYMROOT, needs to be set at the project level. 5637 # and therefore SYMROOT, needs to be set at the project level.
5675 'SYMROOT': '<(DEPTH)/xcodebuild', 5638 'SYMROOT': '<(DEPTH)/xcodebuild',
5676 }, 5639 },
5677 } 5640 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698