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 30 matching lines...) Expand all Loading... |
41 # address space, and it doesn't support cross-compiling). | 41 # address space, and it doesn't support cross-compiling). |
42 use_gold = is_linux && current_cpu == "x64" | 42 use_gold = is_linux && current_cpu == "x64" |
43 | 43 |
44 # use_debug_fission: whether to use split DWARF debug info | 44 # use_debug_fission: whether to use split DWARF debug info |
45 # files. This can reduce link time significantly, but is incompatible | 45 # files. This can reduce link time significantly, but is incompatible |
46 # with some utilities such as icecc and ccache. Requires gold and | 46 # with some utilities such as icecc and ccache. Requires gold and |
47 # gcc >= 4.8 or clang. | 47 # gcc >= 4.8 or clang. |
48 # http://gcc.gnu.org/wiki/DebugFission | 48 # http://gcc.gnu.org/wiki/DebugFission |
49 use_debug_fission = | 49 use_debug_fission = |
50 !is_win && use_gold && linux_use_bundled_binutils && !use_ccache | 50 !is_win && use_gold && linux_use_bundled_binutils && !use_ccache |
| 51 |
| 52 if (is_win) { |
| 53 # Whether the VS xtree header has been patched to disable warning 4702. If |
| 54 # it has, then we don't need to disable 4702 (unreachable code warning). |
| 55 # The patch is preapplied to the internal toolchain and hence all bots. |
| 56 msvs_xtree_patched = false |
| 57 } |
51 } | 58 } |
52 | 59 |
53 # default_include_dirs --------------------------------------------------------- | 60 # default_include_dirs --------------------------------------------------------- |
54 # | 61 # |
55 # This is a separate config so that third_party code (which would not use the | 62 # This is a separate config so that third_party code (which would not use the |
56 # source root and might have conflicting versions of some headers) can remove | 63 # source root and might have conflicting versions of some headers) can remove |
57 # this and specify their own include paths. | 64 # this and specify their own include paths. |
58 config("default_include_dirs") { | 65 config("default_include_dirs") { |
59 include_dirs = [ | 66 include_dirs = [ |
60 "//", | 67 "//", |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 ldflags += [ | 295 ldflags += [ |
289 "-mips32r6", | 296 "-mips32r6", |
290 "-Wl,-melf32ltsmip", | 297 "-Wl,-melf32ltsmip", |
291 ] | 298 ] |
292 } | 299 } |
293 } else if (mips_arch_variant == "r2") { | 300 } else if (mips_arch_variant == "r2") { |
294 cflags += [ | 301 cflags += [ |
295 "-mips32r2", | 302 "-mips32r2", |
296 "-Wa,-mips32r2", | 303 "-Wa,-mips32r2", |
297 ] | 304 ] |
| 305 if (mips_float_abi == "hard" && mips_fpu_mode != "") { |
| 306 cflags += [ "-m$mips_fpu_mode" ] |
| 307 } |
298 } else if (mips_arch_variant == "r1") { | 308 } else if (mips_arch_variant == "r1") { |
299 cflags += [ | 309 cflags += [ |
300 "-mips32", | 310 "-mips32", |
301 "-Wa,-mips32", | 311 "-Wa,-mips32", |
302 ] | 312 ] |
303 } | 313 } |
| 314 |
| 315 if (mips_dsp_rev == 1) { |
| 316 cflags += [ "-mdsp" ] |
| 317 } else if (mips_dsp_rev == 2) { |
| 318 cflags += [ "-mdspr2" ] |
| 319 } |
| 320 |
| 321 cflags += [ "-m${mips_float_abi}-float" ] |
304 } | 322 } |
305 } else if (current_cpu == "mips64el") { | 323 } else if (current_cpu == "mips64el") { |
306 # Don't set the compiler flags for the WebView build. These will come | 324 # Don't set the compiler flags for the WebView build. These will come |
307 # from the Android build system. | 325 # from the Android build system. |
308 if (!is_android_webview_build) { | 326 if (!is_android_webview_build) { |
309 if (mips_arch_variant == "r6") { | 327 if (mips_arch_variant == "r6") { |
310 cflags += [ | 328 cflags += [ |
311 "-mips64r6", | 329 "-mips64r6", |
312 "-Wa,-mips64r6", | 330 "-Wa,-mips64r6", |
313 ] | 331 ] |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 | 720 |
703 # Warnings --------------------------------------------------------------------- | 721 # Warnings --------------------------------------------------------------------- |
704 # | 722 # |
705 # This is where we disable various warnings that we've decided aren't | 723 # This is where we disable various warnings that we've decided aren't |
706 # worthwhile, and enable special warnings. | 724 # worthwhile, and enable special warnings. |
707 | 725 |
708 config("default_warnings") { | 726 config("default_warnings") { |
709 if (is_win) { | 727 if (is_win) { |
710 cflags = [ | 728 cflags = [ |
711 "/WX", # Treat warnings as errors. | 729 "/WX", # Treat warnings as errors. |
| 730 |
712 # Warnings permanently disabled: | 731 # Warnings permanently disabled: |
713 | 732 |
714 # TODO(GYP) The GYP build doesn't have this globally enabled but disabled | 733 # TODO(GYP) The GYP build doesn't have this globally enabled but disabled |
715 # for a bunch of individual targets. Re-enable this globally when those | 734 # for a bunch of individual targets. Re-enable this globally when those |
716 # targets are fixed. | 735 # targets are fixed. |
717 "/wd4018", # Comparing signed and unsigned values. | 736 "/wd4018", # Comparing signed and unsigned values. |
718 | 737 |
719 # C4127: conditional expression is constant | 738 # C4127: conditional expression is constant |
720 # This warning can in theory catch dead code and other problems, but | 739 # This warning can in theory catch dead code and other problems, but |
721 # triggers in far too many desirable cases where the conditional | 740 # triggers in far too many desirable cases where the conditional |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 | 775 |
757 # C4611: interaction between 'function' and C++ object destruction is | 776 # C4611: interaction between 'function' and C++ object destruction is |
758 # non-portable | 777 # non-portable |
759 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN | 778 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN |
760 # suggests using exceptions instead of setjmp/longjmp for C++, but | 779 # suggests using exceptions instead of setjmp/longjmp for C++, but |
761 # Chromium code compiles without exception support. We therefore have to | 780 # Chromium code compiles without exception support. We therefore have to |
762 # use setjmp/longjmp for e.g. JPEG decode error handling, which means we | 781 # use setjmp/longjmp for e.g. JPEG decode error handling, which means we |
763 # have to turn off this warning (and be careful about how object | 782 # have to turn off this warning (and be careful about how object |
764 # destruction happens in such cases). | 783 # destruction happens in such cases). |
765 "/wd4611", | 784 "/wd4611", |
| 785 |
766 # Warnings to evaluate and possibly fix/reenable later: | 786 # Warnings to evaluate and possibly fix/reenable later: |
767 | 787 |
768 "/wd4100", # Unreferenced formal function parameter. | 788 "/wd4100", # Unreferenced formal function parameter. |
769 "/wd4121", # Alignment of a member was sensitive to packing. | 789 "/wd4121", # Alignment of a member was sensitive to packing. |
770 "/wd4244", # Conversion: possible loss of data. | 790 "/wd4244", # Conversion: possible loss of data. |
771 "/wd4481", # Nonstandard extension: override specifier. | 791 "/wd4481", # Nonstandard extension: override specifier. |
772 "/wd4505", # Unreferenced local function has been removed. | 792 "/wd4505", # Unreferenced local function has been removed. |
773 "/wd4510", # Default constructor could not be generated. | 793 "/wd4510", # Default constructor could not be generated. |
774 "/wd4512", # Assignment operator could not be generated. | 794 "/wd4512", # Assignment operator could not be generated. |
775 "/wd4610", # Class can never be instantiated, constructor required. | 795 "/wd4610", # Class can never be instantiated, constructor required. |
776 "/wd4996", # Deprecated function warning. | 796 "/wd4996", # Deprecated function warning. |
777 ] | 797 ] |
| 798 |
| 799 # VS xtree header file needs to be patched or 4702 (unreachable code |
| 800 # warning) is reported if _HAS_EXCEPTIONS=0. Disable the warning if xtree is |
| 801 # not patched. |
| 802 if (!msvs_xtree_patched && |
| 803 exec_script("../../win_is_xtree_patched.py", [], "value") == 0) { |
| 804 cflags += [ "/wd4702" ] # Unreachable code. |
| 805 } |
778 } else { | 806 } else { |
779 # Common GCC warning setup. | 807 # Common GCC warning setup. |
780 cflags = [ | 808 cflags = [ |
781 # Enables. | 809 # Enables. |
782 "-Wendif-labels", # Weird old-style text after an #endif. | 810 "-Wendif-labels", # Weird old-style text after an #endif. |
783 "-Werror", # Warnings as errors. | 811 "-Werror", # Warnings as errors. |
784 | 812 |
785 # Disables. | 813 # Disables. |
786 "-Wno-missing-field-initializers", # "struct foo f = {0};" | 814 "-Wno-missing-field-initializers", # "struct foo f = {0};" |
787 "-Wno-unused-parameter", # Unused function parameters. | 815 "-Wno-unused-parameter", # Unused function parameters. |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 cflags += [ "-gsplit-dwarf" ] | 1109 cflags += [ "-gsplit-dwarf" ] |
1082 } | 1110 } |
1083 } | 1111 } |
1084 } | 1112 } |
1085 | 1113 |
1086 config("no_symbols") { | 1114 config("no_symbols") { |
1087 if (!is_win) { | 1115 if (!is_win) { |
1088 cflags = [ "-g0" ] | 1116 cflags = [ "-g0" ] |
1089 } | 1117 } |
1090 } | 1118 } |
OLD | NEW |