OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 if (current_cpu == "arm") { | 6 if (current_cpu == "arm") { |
7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
8 } | 8 } |
9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
10 import("//build/config/mips.gni") | 10 import("//build/config/mips.gni") |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 719 |
720 # Warnings --------------------------------------------------------------------- | 720 # Warnings --------------------------------------------------------------------- |
721 # | 721 # |
722 # This is where we disable various warnings that we've decided aren't | 722 # This is where we disable various warnings that we've decided aren't |
723 # worthwhile, and enable special warnings. | 723 # worthwhile, and enable special warnings. |
724 | 724 |
725 config("default_warnings") { | 725 config("default_warnings") { |
726 if (is_win) { | 726 if (is_win) { |
727 cflags = [ | 727 cflags = [ |
728 "/WX", # Treat warnings as errors. | 728 "/WX", # Treat warnings as errors. |
| 729 |
729 # Warnings permanently disabled: | 730 # Warnings permanently disabled: |
730 | 731 |
731 # TODO(GYP) The GYP build doesn't have this globally enabled but disabled | 732 # TODO(GYP) The GYP build doesn't have this globally enabled but disabled |
732 # for a bunch of individual targets. Re-enable this globally when those | 733 # for a bunch of individual targets. Re-enable this globally when those |
733 # targets are fixed. | 734 # targets are fixed. |
734 "/wd4018", # Comparing signed and unsigned values. | 735 "/wd4018", # Comparing signed and unsigned values. |
735 | 736 |
736 # C4127: conditional expression is constant | 737 # C4127: conditional expression is constant |
737 # This warning can in theory catch dead code and other problems, but | 738 # This warning can in theory catch dead code and other problems, but |
738 # triggers in far too many desirable cases where the conditional | 739 # triggers in far too many desirable cases where the conditional |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 | 774 |
774 # C4611: interaction between 'function' and C++ object destruction is | 775 # C4611: interaction between 'function' and C++ object destruction is |
775 # non-portable | 776 # non-portable |
776 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN | 777 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN |
777 # suggests using exceptions instead of setjmp/longjmp for C++, but | 778 # suggests using exceptions instead of setjmp/longjmp for C++, but |
778 # Chromium code compiles without exception support. We therefore have to | 779 # Chromium code compiles without exception support. We therefore have to |
779 # use setjmp/longjmp for e.g. JPEG decode error handling, which means we | 780 # use setjmp/longjmp for e.g. JPEG decode error handling, which means we |
780 # have to turn off this warning (and be careful about how object | 781 # have to turn off this warning (and be careful about how object |
781 # destruction happens in such cases). | 782 # destruction happens in such cases). |
782 "/wd4611", | 783 "/wd4611", |
| 784 |
783 # Warnings to evaluate and possibly fix/reenable later: | 785 # Warnings to evaluate and possibly fix/reenable later: |
784 | 786 |
785 "/wd4100", # Unreferenced formal function parameter. | 787 "/wd4100", # Unreferenced formal function parameter. |
786 "/wd4121", # Alignment of a member was sensitive to packing. | 788 "/wd4121", # Alignment of a member was sensitive to packing. |
787 "/wd4244", # Conversion: possible loss of data. | 789 "/wd4244", # Conversion: possible loss of data. |
788 "/wd4481", # Nonstandard extension: override specifier. | 790 "/wd4481", # Nonstandard extension: override specifier. |
789 "/wd4505", # Unreferenced local function has been removed. | 791 "/wd4505", # Unreferenced local function has been removed. |
790 "/wd4510", # Default constructor could not be generated. | 792 "/wd4510", # Default constructor could not be generated. |
791 "/wd4512", # Assignment operator could not be generated. | 793 "/wd4512", # Assignment operator could not be generated. |
792 "/wd4610", # Class can never be instantiated, constructor required. | 794 "/wd4610", # Class can never be instantiated, constructor required. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 } | 918 } |
917 | 919 |
918 # On Windows compiling on x64, VC will issue a warning when converting | 920 # On Windows compiling on x64, VC will issue a warning when converting |
919 # size_t to int because it will truncate the value. Our code should not have | 921 # size_t to int because it will truncate the value. Our code should not have |
920 # these warnings and one should use a static_cast or a checked_cast for the | 922 # these warnings and one should use a static_cast or a checked_cast for the |
921 # conversion depending on the case. However, a lot of code still needs to be | 923 # conversion depending on the case. However, a lot of code still needs to be |
922 # fixed. Apply this config to such targets to disable the warning. | 924 # fixed. Apply this config to such targets to disable the warning. |
923 # | 925 # |
924 # Note that this can be applied regardless of platform and architecture to | 926 # Note that this can be applied regardless of platform and architecture to |
925 # clean up the call sites. This will only apply the flag when necessary. | 927 # clean up the call sites. This will only apply the flag when necessary. |
| 928 # |
| 929 # TODO(jschuh): crbug.com/167187 fix this and delete this config. |
926 config("no_size_t_to_int_warning") { | 930 config("no_size_t_to_int_warning") { |
927 if (is_win && current_cpu == "x64") { | 931 if (is_win && current_cpu == "x64") { |
928 cflags = [ "/wd4267" ] | 932 cflags = [ "/wd4267" ] |
929 } | 933 } |
930 } | 934 } |
931 | 935 |
932 # Optimization ----------------------------------------------------------------- | 936 # Optimization ----------------------------------------------------------------- |
933 # | 937 # |
934 # Note that BUILDCONFIG.gn sets up a variable "default_optimization_config" | 938 # Note that BUILDCONFIG.gn sets up a variable "default_optimization_config" |
935 # which it will assign to the config it implicitly applies to every target. If | 939 # which it will assign to the config it implicitly applies to every target. If |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 cflags += [ "-gsplit-dwarf" ] | 1110 cflags += [ "-gsplit-dwarf" ] |
1107 } | 1111 } |
1108 } | 1112 } |
1109 } | 1113 } |
1110 | 1114 |
1111 config("no_symbols") { | 1115 config("no_symbols") { |
1112 if (!is_win) { | 1116 if (!is_win) { |
1113 cflags = [ "-g0" ] | 1117 cflags = [ "-g0" ] |
1114 } | 1118 } |
1115 } | 1119 } |
OLD | NEW |