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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 # TODO(GYP): is_ubsan, is_ubsan_vptr | 72 # TODO(GYP): is_ubsan, is_ubsan_vptr |
73 if (!is_win) { | 73 if (!is_win) { |
74 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan | 74 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan |
75 } | 75 } |
76 | 76 |
77 # compiler --------------------------------------------------------------------- | 77 # compiler --------------------------------------------------------------------- |
78 # | 78 # |
79 # Base compiler configuration. | 79 # Base compiler configuration. |
80 # | 80 # |
81 # See also "runtime_library" below for related stuff and a discusison about | 81 # See also "runtime_library" below for related stuff and a discussion about |
82 # where stuff should go. Put warning related stuff in the "warnings" config. | 82 # where stuff should go. Put warning related stuff in the "warnings" config. |
83 | 83 |
84 config("compiler") { | 84 config("compiler") { |
85 cflags = [] | 85 cflags = [] |
86 cflags_c = [] | 86 cflags_c = [] |
87 cflags_cc = [] | 87 cflags_cc = [] |
88 ldflags = [] | 88 ldflags = [] |
89 defines = [] | 89 defines = [] |
90 | 90 |
91 # In general, Windows is totally different, but all the other builds share | 91 # In general, Windows is totally different, but all the other builds share |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 # Experimentation found that using four linking threads | 392 # Experimentation found that using four linking threads |
393 # saved ~20% of link time. | 393 # saved ~20% of link time. |
394 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa
d/thread/281527606915bb36 | 394 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa
d/thread/281527606915bb36 |
395 # Only apply this to the target linker, since the host | 395 # Only apply this to the target linker, since the host |
396 # linker might not be gold, but isn't used much anyway. | 396 # linker might not be gold, but isn't used much anyway. |
397 # TODO(raymes): Disable threading because gold is frequently | 397 # TODO(raymes): Disable threading because gold is frequently |
398 # crashing on the bots: crbug.com/161942. | 398 # crashing on the bots: crbug.com/161942. |
399 #"-Wl,--threads", | 399 #"-Wl,--threads", |
400 #"-Wl,--thread-count=4", | 400 #"-Wl,--thread-count=4", |
401 ] | 401 ] |
| 402 |
| 403 # TODO(thestig): Make this flag work with GN. |
| 404 #if (!is_official_build && !is_chromeos && !(is_asan || is_lsan || is_tsan |
| is_msan)) { |
| 405 # ldflags += [ |
| 406 # "-Wl,--detect-odr-violations", |
| 407 # ] |
| 408 #} |
402 } | 409 } |
403 | 410 |
404 if (linux_use_bundled_binutils) { | 411 if (linux_use_bundled_binutils) { |
405 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 412 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
406 root_build_dir) | 413 root_build_dir) |
407 cflags += [ "-B$binutils_path" ] | 414 cflags += [ "-B$binutils_path" ] |
408 } | 415 } |
409 | 416 |
410 # Clang-specific compiler flags setup. | 417 # Clang-specific compiler flags setup. |
411 # ------------------------------------ | 418 # ------------------------------------ |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 | 719 |
713 # Warnings --------------------------------------------------------------------- | 720 # Warnings --------------------------------------------------------------------- |
714 # | 721 # |
715 # 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 |
716 # worthwhile, and enable special warnings. | 723 # worthwhile, and enable special warnings. |
717 | 724 |
718 config("default_warnings") { | 725 config("default_warnings") { |
719 if (is_win) { | 726 if (is_win) { |
720 cflags = [ | 727 cflags = [ |
721 "/WX", # Treat warnings as errors. | 728 "/WX", # Treat warnings as errors. |
722 | |
723 # Warnings permanently disabled: | 729 # Warnings permanently disabled: |
724 | 730 |
725 # TODO(GYP) The GYP build doesn't have this globally enabled but disabled | 731 # TODO(GYP) The GYP build doesn't have this globally enabled but disabled |
726 # for a bunch of individual targets. Re-enable this globally when those | 732 # for a bunch of individual targets. Re-enable this globally when those |
727 # targets are fixed. | 733 # targets are fixed. |
728 "/wd4018", # Comparing signed and unsigned values. | 734 "/wd4018", # Comparing signed and unsigned values. |
729 | 735 |
730 # C4127: conditional expression is constant | 736 # C4127: conditional expression is constant |
731 # This warning can in theory catch dead code and other problems, but | 737 # This warning can in theory catch dead code and other problems, but |
732 # triggers in far too many desirable cases where the conditional | 738 # triggers in far too many desirable cases where the conditional |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 | 773 |
768 # C4611: interaction between 'function' and C++ object destruction is | 774 # C4611: interaction between 'function' and C++ object destruction is |
769 # non-portable | 775 # non-portable |
770 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN | 776 # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN |
771 # suggests using exceptions instead of setjmp/longjmp for C++, but | 777 # suggests using exceptions instead of setjmp/longjmp for C++, but |
772 # Chromium code compiles without exception support. We therefore have to | 778 # Chromium code compiles without exception support. We therefore have to |
773 # use setjmp/longjmp for e.g. JPEG decode error handling, which means we | 779 # use setjmp/longjmp for e.g. JPEG decode error handling, which means we |
774 # have to turn off this warning (and be careful about how object | 780 # have to turn off this warning (and be careful about how object |
775 # destruction happens in such cases). | 781 # destruction happens in such cases). |
776 "/wd4611", | 782 "/wd4611", |
777 | |
778 # Warnings to evaluate and possibly fix/reenable later: | 783 # Warnings to evaluate and possibly fix/reenable later: |
779 | 784 |
780 "/wd4100", # Unreferenced formal function parameter. | 785 "/wd4100", # Unreferenced formal function parameter. |
781 "/wd4121", # Alignment of a member was sensitive to packing. | 786 "/wd4121", # Alignment of a member was sensitive to packing. |
782 "/wd4244", # Conversion: possible loss of data. | 787 "/wd4244", # Conversion: possible loss of data. |
783 "/wd4481", # Nonstandard extension: override specifier. | 788 "/wd4481", # Nonstandard extension: override specifier. |
784 "/wd4505", # Unreferenced local function has been removed. | 789 "/wd4505", # Unreferenced local function has been removed. |
785 "/wd4510", # Default constructor could not be generated. | 790 "/wd4510", # Default constructor could not be generated. |
786 "/wd4512", # Assignment operator could not be generated. | 791 "/wd4512", # Assignment operator could not be generated. |
787 "/wd4610", # Class can never be instantiated, constructor required. | 792 "/wd4610", # Class can never be instantiated, constructor required. |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 cflags += [ "-gsplit-dwarf" ] | 1106 cflags += [ "-gsplit-dwarf" ] |
1102 } | 1107 } |
1103 } | 1108 } |
1104 } | 1109 } |
1105 | 1110 |
1106 config("no_symbols") { | 1111 config("no_symbols") { |
1107 if (!is_win) { | 1112 if (!is_win) { |
1108 cflags = [ "-g0" ] | 1113 cflags = [ "-g0" ] |
1109 } | 1114 } |
1110 } | 1115 } |
OLD | NEW |