| 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 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
| 7 import("//build/config/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
| 8 import("//build/config/nacl/config.gni") | 8 import("//build/config/nacl/config.gni") |
| 9 import("//build/toolchain/ccache.gni") | 9 import("//build/toolchain/ccache.gni") |
| 10 | 10 |
| 11 if (current_cpu == "arm") { | 11 if (current_cpu == "arm") { |
| 12 import("//build/config/arm.gni") | 12 import("//build/config/arm.gni") |
| 13 } | 13 } |
| 14 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 14 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| 15 import("//build/config/mips.gni") | 15 import("//build/config/mips.gni") |
| 16 } | 16 } |
| 17 if (is_posix) { | |
| 18 import("//build/config/gcc/gcc_version.gni") | |
| 19 } | |
| 20 if (is_win) { | 17 if (is_win) { |
| 21 import("//build/config/win/visual_studio_version.gni") | 18 import("//build/config/win/visual_studio_version.gni") |
| 22 } | 19 } |
| 23 | 20 |
| 24 declare_args() { | 21 declare_args() { |
| 25 # Default to warnings as errors for default workflow, where we catch | 22 # Default to warnings as errors for default workflow, where we catch |
| 26 # warnings with known toolchains. Allow overriding this e.g. for Chromium | 23 # warnings with known toolchains. Allow overriding this e.g. for Chromium |
| 27 # builds on Linux that could use a different version of the compiler. | 24 # builds on Linux that could use a different version of the compiler. |
| 28 treat_warnings_as_errors = true | 25 treat_warnings_as_errors = true |
| 29 | 26 |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 cflags += [ "-Werror" ] | 785 cflags += [ "-Werror" ] |
| 789 } | 786 } |
| 790 | 787 |
| 791 if (is_mac && !is_nacl) { | 788 if (is_mac && !is_nacl) { |
| 792 # When compiling Objective-C, warns if a method is used whose | 789 # When compiling Objective-C, warns if a method is used whose |
| 793 # availability is newer than the deployment target. This is not | 790 # availability is newer than the deployment target. This is not |
| 794 # required when compiling Chrome for iOS. | 791 # required when compiling Chrome for iOS. |
| 795 cflags += [ "-Wpartial-availability" ] | 792 cflags += [ "-Wpartial-availability" ] |
| 796 } | 793 } |
| 797 | 794 |
| 798 if (gcc_version >= 48) { | |
| 799 cflags_cc += [ | |
| 800 # See comment for -Wno-c++11-narrowing. | |
| 801 "-Wno-narrowing", | |
| 802 ] | |
| 803 if (!is_clang && is_chromeos) { | |
| 804 cflags_cc += [ | |
| 805 # TODO(thakis): Remove, http://crbug.com/263960 | |
| 806 "-Wno-literal-suffix", | |
| 807 ] | |
| 808 } | |
| 809 } | |
| 810 | |
| 811 # Suppress warnings about ABI changes on ARM (Clang doesn't give this | 795 # Suppress warnings about ABI changes on ARM (Clang doesn't give this |
| 812 # warning). | 796 # warning). |
| 813 if (current_cpu == "arm" && !is_clang) { | 797 if (current_cpu == "arm" && !is_clang) { |
| 814 cflags += [ "-Wno-psabi" ] | 798 cflags += [ "-Wno-psabi" ] |
| 815 } | 799 } |
| 816 | 800 |
| 817 if (gcc_version >= 48) { | 801 if (!is_clang) { |
| 802 cflags_cc += [ |
| 803 # See comment for -Wno-c++11-narrowing. |
| 804 "-Wno-narrowing", |
| 805 ] |
| 806 |
| 818 # Don't warn about the "typedef 'foo' locally defined but not used" | 807 # Don't warn about the "typedef 'foo' locally defined but not used" |
| 819 # for gcc 4.8. | 808 # for gcc 4.8. |
| 820 # TODO: remove this flag once all builds work. See crbug.com/227506 | 809 # TODO: remove this flag once all builds work. See crbug.com/227506 |
| 821 cflags += [ "-Wno-unused-local-typedefs" ] | 810 cflags += [ "-Wno-unused-local-typedefs" ] |
| 822 } | 811 } |
| 823 } | 812 } |
| 824 | 813 |
| 825 # Common Clang and GCC warning setup. | 814 # Common Clang and GCC warning setup. |
| 826 if (!is_win || is_clang) { | 815 if (!is_win || is_clang) { |
| 827 cflags += [ | 816 cflags += [ |
| 828 # Disables. | 817 # Disables. |
| 829 "-Wno-missing-field-initializers", # "struct foo f = {0};" | 818 "-Wno-missing-field-initializers", # "struct foo f = {0};" |
| 830 "-Wno-unused-parameter", # Unused function parameters. | 819 "-Wno-unused-parameter", # Unused function parameters. |
| 831 ] | 820 ] |
| 832 } | 821 } |
| 833 | 822 |
| 823 if (is_chromeos) { |
| 824 # TODO(thakis): Remove, http://crbug.com/263960 |
| 825 if (is_clang) { |
| 826 cflags_cc += [ "-Wno-reserved-user-defined-literal" ] |
| 827 } else { |
| 828 cflags_cc += [ "-Wno-literal-suffix" ] |
| 829 } |
| 830 } |
| 831 |
| 834 if (is_clang) { | 832 if (is_clang) { |
| 835 cflags += [ | 833 cflags += [ |
| 836 # TODO(thakis): Add -Wfor-loop-analysis to -Wall in clang, remove this: | 834 # TODO(thakis): Add -Wfor-loop-analysis to -Wall in clang, remove this: |
| 837 "-Wfor-loop-analysis", | 835 "-Wfor-loop-analysis", |
| 838 | 836 |
| 839 # TODO(thakis): Consider -Wloop-analysis (turns on | 837 # TODO(thakis): Consider -Wloop-analysis (turns on |
| 840 # -Wrange-loop-analysis too). | 838 # -Wrange-loop-analysis too). |
| 841 | 839 |
| 842 # This warns on using ints as initializers for floats in | 840 # This warns on using ints as initializers for floats in |
| 843 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), | 841 # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), |
| (...skipping 12 matching lines...) Expand all Loading... |
| 856 | 854 |
| 857 # TODO(thakis): This used to be implied by -Wno-unused-function, | 855 # TODO(thakis): This used to be implied by -Wno-unused-function, |
| 858 # which we no longer use. Check if it makes sense to remove | 856 # which we no longer use. Check if it makes sense to remove |
| 859 # this as well. http://crbug.com/316352 | 857 # this as well. http://crbug.com/316352 |
| 860 "-Wno-unneeded-internal-declaration", | 858 "-Wno-unneeded-internal-declaration", |
| 861 | 859 |
| 862 # TODO(hans): Get this cleaned up, http://crbug.com/428099 | 860 # TODO(hans): Get this cleaned up, http://crbug.com/428099 |
| 863 "-Wno-inconsistent-missing-override", | 861 "-Wno-inconsistent-missing-override", |
| 864 ] | 862 ] |
| 865 | 863 |
| 866 if (is_chromeos) { | |
| 867 cflags += [ | |
| 868 # TODO(thakis): Remove, http://crbug.com/263960 | |
| 869 "-Wno-reserved-user-defined-literal", | |
| 870 ] | |
| 871 } | |
| 872 | |
| 873 # NaCl's Clang compiler and Chrome's hermetic Clang compiler will almost | 864 # NaCl's Clang compiler and Chrome's hermetic Clang compiler will almost |
| 874 # always have different versions. Certain flags may not be recognized by | 865 # always have different versions. Certain flags may not be recognized by |
| 875 # one version or the other. | 866 # one version or the other. |
| 876 if (!is_nacl) { | 867 if (!is_nacl) { |
| 877 # Flags NaCl (Clang 3.7) does not recognize. | 868 # Flags NaCl (Clang 3.7) does not recognize. |
| 878 cflags += [ | 869 cflags += [ |
| 879 # TODO(thakis): Enable this, crbug.com/507717 | 870 # TODO(thakis): Enable this, crbug.com/507717 |
| 880 "-Wno-shift-negative-value", | 871 "-Wno-shift-negative-value", |
| 881 ] | 872 ] |
| 882 } | 873 } |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 if (symbol_level == 0) { | 1286 if (symbol_level == 0) { |
| 1296 configs = [ ":no_symbols" ] | 1287 configs = [ ":no_symbols" ] |
| 1297 } else if (symbol_level == 1) { | 1288 } else if (symbol_level == 1) { |
| 1298 configs = [ ":minimal_symbols" ] | 1289 configs = [ ":minimal_symbols" ] |
| 1299 } else if (symbol_level == 2) { | 1290 } else if (symbol_level == 2) { |
| 1300 configs = [ ":symbols" ] | 1291 configs = [ ":symbols" ] |
| 1301 } else { | 1292 } else { |
| 1302 assert(false) | 1293 assert(false) |
| 1303 } | 1294 } |
| 1304 } | 1295 } |
| OLD | NEW |