| 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/config/sanitizers/sanitizers.gni") | |
| 10 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
| 11 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
| 12 import("//build_overrides/build.gni") | 11 import("//build_overrides/build.gni") |
| 13 | 12 |
| 14 if (current_cpu == "arm" || current_cpu == "arm64") { | 13 if (current_cpu == "arm" || current_cpu == "arm64") { |
| 15 import("//build/config/arm.gni") | 14 import("//build/config/arm.gni") |
| 16 } | 15 } |
| 17 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 16 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| 18 import("//build/config/mips.gni") | 17 import("//build/config/mips.gni") |
| 19 } | 18 } |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 # Assume UTF-8 by default to avoid code page dependencies. | 1075 # Assume UTF-8 by default to avoid code page dependencies. |
| 1077 cflags += [ "/utf-8" ] | 1076 cflags += [ "/utf-8" ] |
| 1078 } else { | 1077 } else { |
| 1079 cflags = [ "-Wall" ] | 1078 cflags = [ "-Wall" ] |
| 1080 if (treat_warnings_as_errors) { | 1079 if (treat_warnings_as_errors) { |
| 1081 cflags += [ "-Werror" ] | 1080 cflags += [ "-Werror" ] |
| 1082 | 1081 |
| 1083 # The compiler driver can sometimes (rarely) emit warnings before calling | 1082 # The compiler driver can sometimes (rarely) emit warnings before calling |
| 1084 # the actual linker. Make sure these warnings are treated as errors as | 1083 # the actual linker. Make sure these warnings are treated as errors as |
| 1085 # well. | 1084 # well. |
| 1086 # TODO(thakis): Enable in use_custom_libcxx builds, crbug.com/669072 | 1085 ldflags = [ "-Werror" ] |
| 1087 if (!use_custom_libcxx) { | |
| 1088 ldflags = [ "-Werror" ] | |
| 1089 } | |
| 1090 } | 1086 } |
| 1091 if (is_clang) { | 1087 if (is_clang) { |
| 1092 # Enable -Wextra for chromium_code when we control the compiler. | 1088 # Enable -Wextra for chromium_code when we control the compiler. |
| 1093 cflags += [ "-Wextra" ] | 1089 cflags += [ "-Wextra" ] |
| 1094 } | 1090 } |
| 1095 | 1091 |
| 1096 # In Chromium code, we define __STDC_foo_MACROS in order to get the | 1092 # In Chromium code, we define __STDC_foo_MACROS in order to get the |
| 1097 # C99 macros on Mac and Linux. | 1093 # C99 macros on Mac and Linux. |
| 1098 defines = [ | 1094 defines = [ |
| 1099 "__STDC_CONSTANT_MACROS", | 1095 "__STDC_CONSTANT_MACROS", |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 ] | 1132 ] |
| 1137 defines += [ | 1133 defines += [ |
| 1138 "_CRT_NONSTDC_NO_WARNINGS", | 1134 "_CRT_NONSTDC_NO_WARNINGS", |
| 1139 "_CRT_NONSTDC_NO_DEPRECATE", | 1135 "_CRT_NONSTDC_NO_DEPRECATE", |
| 1140 ] | 1136 ] |
| 1141 } else { | 1137 } else { |
| 1142 # GCC may emit unsuppressible warnings so don't add -Werror for no chromium | 1138 # GCC may emit unsuppressible warnings so don't add -Werror for no chromium |
| 1143 # code. crbug.com/589724 | 1139 # code. crbug.com/589724 |
| 1144 if (treat_warnings_as_errors && is_clang) { | 1140 if (treat_warnings_as_errors && is_clang) { |
| 1145 cflags += [ "-Werror" ] | 1141 cflags += [ "-Werror" ] |
| 1146 | 1142 ldflags = [ "-Werror" ] |
| 1147 # TODO(thakis): Enable in use_custom_libcxx builds, crbug.com/669072 | |
| 1148 if (!use_custom_libcxx) { | |
| 1149 ldflags = [ "-Werror" ] | |
| 1150 } | |
| 1151 } | 1143 } |
| 1152 if (is_clang && !is_nacl) { | 1144 if (is_clang && !is_nacl) { |
| 1153 # TODO(thakis): Remove !is_nacl once | 1145 # TODO(thakis): Remove !is_nacl once |
| 1154 # https://codereview.webrtc.org/1552863002/ made its way into chromium. | 1146 # https://codereview.webrtc.org/1552863002/ made its way into chromium. |
| 1155 cflags += [ "-Wall" ] | 1147 cflags += [ "-Wall" ] |
| 1156 } | 1148 } |
| 1157 } | 1149 } |
| 1158 | 1150 |
| 1159 if (is_clang) { | 1151 if (is_clang) { |
| 1160 cflags += [ | 1152 cflags += [ |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 | 1639 |
| 1648 if (is_ios || is_mac) { | 1640 if (is_ios || is_mac) { |
| 1649 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1641 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1650 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1642 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1651 config("enable_arc") { | 1643 config("enable_arc") { |
| 1652 common_flags = [ "-fobjc-arc" ] | 1644 common_flags = [ "-fobjc-arc" ] |
| 1653 cflags_objc = common_flags | 1645 cflags_objc = common_flags |
| 1654 cflags_objcc = common_flags | 1646 cflags_objcc = common_flags |
| 1655 } | 1647 } |
| 1656 } | 1648 } |
| OLD | NEW |