| 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 if (current_cpu == "arm") { | 7 if (current_cpu == "arm") { |
| 8 import("//build/config/arm.gni") | 8 import("//build/config/arm.gni") |
| 9 } | 9 } |
| 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 default_warning_flags_cc = [] | 739 default_warning_flags_cc = [] |
| 740 | 740 |
| 741 # Common GCC warning setup. | 741 # Common GCC warning setup. |
| 742 default_warning_flags += [ | 742 default_warning_flags += [ |
| 743 # Enables. | 743 # Enables. |
| 744 "-Wendif-labels", # Weird old-style text after an #endif. | 744 "-Wendif-labels", # Weird old-style text after an #endif. |
| 745 "-Werror", # Warnings as errors. | 745 "-Werror", # Warnings as errors. |
| 746 | 746 |
| 747 # Disables. | 747 # Disables. |
| 748 "-Wno-missing-field-initializers", # "struct foo f = {0};" | 748 "-Wno-missing-field-initializers", # "struct foo f = {0};" |
| 749 "-Wno-unused-parameter", # Unused function parameters. | |
| 750 ] | 749 ] |
| 751 | 750 |
| 752 if (is_mac) { | 751 if (is_mac) { |
| 753 default_warning_flags += [ "-Wnewline-eof" ] | 752 default_warning_flags += [ "-Wnewline-eof" ] |
| 754 if (!is_nacl) { | 753 if (!is_nacl) { |
| 755 # When compiling Objective-C, warns if a method is used whose | 754 # When compiling Objective-C, warns if a method is used whose |
| 756 # availability is newer than the deployment target. This is not | 755 # availability is newer than the deployment target. This is not |
| 757 # required when compiling Chrome for iOS. | 756 # required when compiling Chrome for iOS. |
| 758 default_warning_flags += [ "-Wpartial-availability" ] | 757 default_warning_flags += [ "-Wpartial-availability" ] |
| 759 } | 758 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 "-Wno-char-subscripts", | 817 "-Wno-char-subscripts", |
| 819 | 818 |
| 820 # Warns on switches on enums that cover all enum values but | 819 # Warns on switches on enums that cover all enum values but |
| 821 # also contain a default: branch. Chrome is full of that. | 820 # also contain a default: branch. Chrome is full of that. |
| 822 "-Wno-covered-switch-default", | 821 "-Wno-covered-switch-default", |
| 823 | 822 |
| 824 # Clang considers the `register` keyword as deprecated, but e.g. | 823 # Clang considers the `register` keyword as deprecated, but e.g. |
| 825 # code generated by flex (used in angle) contains that keyword. | 824 # code generated by flex (used in angle) contains that keyword. |
| 826 # http://crbug.com/255186 | 825 # http://crbug.com/255186 |
| 827 "-Wno-deprecated-register", | 826 "-Wno-deprecated-register", |
| 828 | |
| 829 # TODO(thakis): This used to be implied by -Wno-unused-function, | |
| 830 # which we no longer use. Check if it makes sense to remove | |
| 831 # this as well. http://crbug.com/316352 | |
| 832 "-Wno-unneeded-internal-declaration", | |
| 833 | |
| 834 # TODO(thakis): Remove, http://crbug.com/263960 | |
| 835 "-Wno-reserved-user-defined-literal", | |
| 836 | |
| 837 # TODO(hans): Get this cleaned up. | |
| 838 "-Wno-inconsistent-missing-override", | |
| 839 ] | 827 ] |
| 840 | 828 |
| 841 # NaCl's Clang compiler and Chrome's hermetic Clang compiler will almost | 829 # NaCl's Clang compiler and Chrome's hermetic Clang compiler will almost |
| 842 # always have different versions. Certain flags may not be recognized by | 830 # always have different versions. Certain flags may not be recognized by |
| 843 # one version or the other. | 831 # one version or the other. |
| 844 if (!is_nacl) { | 832 if (!is_nacl) { |
| 845 # Flags NaCl (Clang 3.7) does not recognize. | 833 # Flags NaCl (Clang 3.7) does not recognize. |
| 846 default_warning_flags += [ | 834 default_warning_flags += [ |
| 847 # TODO(smklein): Enable this, crbug.com/507717 | 835 # TODO(smklein): Enable this, crbug.com/507717 |
| 848 "-Wno-shift-negative-value", | 836 "-Wno-shift-negative-value", |
| 849 | |
| 850 # TODO(smklein): Consider enabling this once not broken by third party | |
| 851 "-Wno-bitfield-width", | |
| 852 ] | 837 ] |
| 853 } | 838 } |
| 854 } | 839 } |
| 855 | 840 |
| 856 # chromium_code --------------------------------------------------------------- | 841 # chromium_code --------------------------------------------------------------- |
| 857 # | 842 # |
| 858 # Toggles between higher and lower warnings for code that is (or isn't) | 843 # Toggles between higher and lower warnings for code that is (or isn't) |
| 859 # part of Chromium. | 844 # part of Chromium. |
| 860 | 845 |
| 861 config("chromium_code") { | 846 config("chromium_code") { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 cflags += [ | 897 cflags += [ |
| 913 # Don't warn about printf format problems. This is off by default in gcc | 898 # Don't warn about printf format problems. This is off by default in gcc |
| 914 # but on in Ubuntu's gcc(!). | 899 # but on in Ubuntu's gcc(!). |
| 915 "-Wno-format", | 900 "-Wno-format", |
| 916 ] | 901 ] |
| 917 cflags_cc += [ | 902 cflags_cc += [ |
| 918 # Don't warn about hash_map in third-party code. | 903 # Don't warn about hash_map in third-party code. |
| 919 "-Wno-deprecated", | 904 "-Wno-deprecated", |
| 920 ] | 905 ] |
| 921 } | 906 } |
| 907 |
| 908 if (is_clang) { |
| 909 cflags += [ |
| 910 # TODO(hans): Get this cleaned up. |
| 911 "-Wno-inconsistent-missing-override", |
| 912 ] |
| 913 } |
| 914 |
| 922 cflags += default_warning_flags | 915 cflags += default_warning_flags |
| 923 cflags_cc += default_warning_flags_cc | 916 cflags_cc += default_warning_flags_cc |
| 924 } | 917 } |
| 925 | 918 |
| 926 # rtti ------------------------------------------------------------------------ | 919 # rtti ------------------------------------------------------------------------ |
| 927 # | 920 # |
| 928 # Allows turning Run-Time Type Identification on or off. | 921 # Allows turning Run-Time Type Identification on or off. |
| 929 | 922 |
| 930 config("rtti") { | 923 config("rtti") { |
| 931 } | 924 } |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 if (symbol_level == 0) { | 1110 if (symbol_level == 0) { |
| 1118 configs = [ ":no_symbols" ] | 1111 configs = [ ":no_symbols" ] |
| 1119 } else if (symbol_level == 1) { | 1112 } else if (symbol_level == 1) { |
| 1120 configs = [ ":minimal_symbols" ] | 1113 configs = [ ":minimal_symbols" ] |
| 1121 } else if (symbol_level == 2) { | 1114 } else if (symbol_level == 2) { |
| 1122 configs = [ ":symbols" ] | 1115 configs = [ ":symbols" ] |
| 1123 } else { | 1116 } else { |
| 1124 assert(false) | 1117 assert(false) |
| 1125 } | 1118 } |
| 1126 } | 1119 } |
| OLD | NEW |