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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 # Allow comparing the address of references and 'this' against 0 | 150 # Allow comparing the address of references and 'this' against 0 |
151 # in debug builds. Technically, these can never be null in | 151 # in debug builds. Technically, these can never be null in |
152 # well-defined C/C++ and Clang can optimize such checks away in | 152 # well-defined C/C++ and Clang can optimize such checks away in |
153 # release builds, but they may be used in asserts in debug builds. | 153 # release builds, but they may be used in asserts in debug builds. |
154 cflags_cc += [ | 154 cflags_cc += [ |
155 "-Wno-undefined-bool-conversion", | 155 "-Wno-undefined-bool-conversion", |
156 "-Wno-tautological-undefined-compare", | 156 "-Wno-tautological-undefined-compare", |
157 ] | 157 ] |
158 } | 158 } |
159 | 159 |
160 if (is_clang && !is_win) { | 160 if (is_clang && !is_win && !is_nacl) { |
161 # This is here so that all files get recompiled after a clang roll and | 161 # This is here so that all files get recompiled after a clang roll and |
162 # when turning clang on or off. (defines are passed via the command line, | 162 # when turning clang on or off. (defines are passed via the command line, |
163 # and build system rebuild things when their commandline changes). Nothing | 163 # and build system rebuild things when their commandline changes). Nothing |
164 # should ever read this define. | 164 # should ever read this define. |
165 defines += [ "CR_CLANG_REVISION=" + | 165 defines += [ "CR_CLANG_REVISION=" + |
166 exec_script("//tools/clang/scripts/posix-print-revision.py", | 166 exec_script("//tools/clang/scripts/posix-print-revision.py", |
167 [], | 167 [], |
168 "value") ] | 168 "value") ] |
169 } | 169 } |
170 | 170 |
(...skipping 548 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 cflags += [ "-gsplit-dwarf" ] | 1108 cflags += [ "-gsplit-dwarf" ] |
1107 } | 1109 } |
1108 } | 1110 } |
1109 } | 1111 } |
1110 | 1112 |
1111 config("no_symbols") { | 1113 config("no_symbols") { |
1112 if (!is_win) { | 1114 if (!is_win) { |
1113 cflags = [ "-g0" ] | 1115 cflags = [ "-g0" ] |
1114 } | 1116 } |
1115 } | 1117 } |
OLD | NEW |