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 |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 | 887 |
888 # chromium_code --------------------------------------------------------------- | 888 # chromium_code --------------------------------------------------------------- |
889 # | 889 # |
890 # Toggles between higher and lower warnings for code that is (or isn't) | 890 # Toggles between higher and lower warnings for code that is (or isn't) |
891 # part of Chromium. | 891 # part of Chromium. |
892 | 892 |
893 config("chromium_code") { | 893 config("chromium_code") { |
894 if (is_win) { | 894 if (is_win) { |
895 cflags = [ "/W4" ] # Warning level 4. | 895 cflags = [ "/W4" ] # Warning level 4. |
896 } else { | 896 } else { |
897 cflags = [ | 897 cflags = [ "-Wall" ] |
898 "-Wall", | |
899 | 898 |
900 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, | 899 # TODO(thakis): Remove !is_nacl once |
901 # so we specify it explicitly. | 900 # https://codereview.webrtc.org/1552863002/ made its way into chromium. |
902 # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. | 901 if (is_clang && !is_nacl) { |
903 # http://code.google.com/p/chromium/issues/detail?id=90453 | 902 # Enable -Wextra when we control the compiler. |
904 "-Wsign-compare", | 903 cflags += [ "-Wextra" ] |
905 ] | 904 } |
906 | 905 |
907 # In Chromium code, we define __STDC_foo_MACROS in order to get the | 906 # In Chromium code, we define __STDC_foo_MACROS in order to get the |
908 # C99 macros on Mac and Linux. | 907 # C99 macros on Mac and Linux. |
909 defines = [ | 908 defines = [ |
910 "__STDC_CONSTANT_MACROS", | 909 "__STDC_CONSTANT_MACROS", |
911 "__STDC_FORMAT_MACROS", | 910 "__STDC_FORMAT_MACROS", |
912 ] | 911 ] |
913 | 912 |
914 if (!is_debug && !using_sanitizer && | 913 if (!is_debug && !using_sanitizer && |
915 (!is_linux || !is_clang || is_official_build)) { | 914 (!is_linux || !is_clang || is_official_build)) { |
(...skipping 21 matching lines...) Expand all Loading... |
937 cflags += [ | 936 cflags += [ |
938 "/W3", # Warning level 3. | 937 "/W3", # Warning level 3. |
939 "/wd4800", # Disable warning when forcing value to bool. | 938 "/wd4800", # Disable warning when forcing value to bool. |
940 "/wd4267", # TODO(jschuh): size_t to int. | 939 "/wd4267", # TODO(jschuh): size_t to int. |
941 "/wd4996", # Deprecated function warning. | 940 "/wd4996", # Deprecated function warning. |
942 ] | 941 ] |
943 defines += [ | 942 defines += [ |
944 "_CRT_NONSTDC_NO_WARNINGS", | 943 "_CRT_NONSTDC_NO_WARNINGS", |
945 "_CRT_NONSTDC_NO_DEPRECATE", | 944 "_CRT_NONSTDC_NO_DEPRECATE", |
946 ] | 945 ] |
| 946 } else if (is_clang && !is_nacl) { |
| 947 # TODO(thakis): Remove !is_nacl once |
| 948 # https://codereview.webrtc.org/1552863002/ made its way into chromium. |
| 949 cflags += [ "-Wall" ] |
947 } | 950 } |
948 | 951 |
949 if (is_linux) { | 952 if (is_linux) { |
950 # Don't warn about ignoring the return value from e.g. close(). This is | 953 # Don't warn about ignoring the return value from e.g. close(). This is |
951 # off by default in some gccs but on by default in others. BSD systems do | 954 # off by default in some gccs but on by default in others. BSD systems do |
952 # not support this option, since they are usually using gcc 4.2.1, which | 955 # not support this option, since they are usually using gcc 4.2.1, which |
953 # does not have this flag yet. | 956 # does not have this flag yet. |
954 cflags += [ "-Wno-unused-result" ] | 957 cflags += [ "-Wno-unused-result" ] |
955 } | 958 } |
956 | 959 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 if (symbol_level == 0) { | 1310 if (symbol_level == 0) { |
1308 configs = [ ":no_symbols" ] | 1311 configs = [ ":no_symbols" ] |
1309 } else if (symbol_level == 1) { | 1312 } else if (symbol_level == 1) { |
1310 configs = [ ":minimal_symbols" ] | 1313 configs = [ ":minimal_symbols" ] |
1311 } else if (symbol_level == 2) { | 1314 } else if (symbol_level == 2) { |
1312 configs = [ ":symbols" ] | 1315 configs = [ ":symbols" ] |
1313 } else { | 1316 } else { |
1314 assert(false) | 1317 assert(false) |
1315 } | 1318 } |
1316 } | 1319 } |
OLD | NEW |