Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 2521913005: posix: Pass -Werror to the compiler driver for link invocations as well. (Closed)
Patch Set: scale back a bit Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chromecast_build.gni")
7 import("//build/config/compiler/compiler.gni") 8 import("//build/config/compiler/compiler.gni")
8 import("//build/config/nacl/config.gni") 9 import("//build/config/nacl/config.gni")
10 import("//build/config/sanitizers/sanitizers.gni")
9 import("//build/toolchain/cc_wrapper.gni") 11 import("//build/toolchain/cc_wrapper.gni")
10 import("//build/toolchain/toolchain.gni") 12 import("//build/toolchain/toolchain.gni")
11 import("//build_overrides/build.gni") 13 import("//build_overrides/build.gni")
12 14
13 if (current_cpu == "arm" || current_cpu == "arm64") { 15 if (current_cpu == "arm" || current_cpu == "arm64") {
14 import("//build/config/arm.gni") 16 import("//build/config/arm.gni")
15 } 17 }
16 if (current_cpu == "mipsel" || current_cpu == "mips64el") { 18 if (current_cpu == "mipsel" || current_cpu == "mips64el") {
17 import("//build/config/mips.gni") 19 import("//build/config/mips.gni")
18 } 20 }
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 # Toggles between higher and lower warnings for code that is (or isn't) 1051 # Toggles between higher and lower warnings for code that is (or isn't)
1050 # part of Chromium. 1052 # part of Chromium.
1051 1053
1052 config("chromium_code") { 1054 config("chromium_code") {
1053 if (is_win) { 1055 if (is_win) {
1054 cflags = [ "/W4" ] # Warning level 4. 1056 cflags = [ "/W4" ] # Warning level 4.
1055 } else { 1057 } else {
1056 cflags = [ "-Wall" ] 1058 cflags = [ "-Wall" ]
1057 if (treat_warnings_as_errors) { 1059 if (treat_warnings_as_errors) {
1058 cflags += [ "-Werror" ] 1060 cflags += [ "-Werror" ]
1061
1062 # The compiler driver can sometimes (rarely) emit warnings before calling
1063 # the actual linker. Make sure these warnings are treated as errors as
1064 # well.
1065 # TODO(thakis): Enable this in use_custom_libcxx (asan) builds.
1066 # TODO(thakis): Enable this in chromecast builds.
1067 if (!use_custom_libcxx && !is_chromecast) {
1068 ldflags = [ "-Werror" ]
1069 }
1059 } 1070 }
1060 if (is_clang) { 1071 if (is_clang) {
1061 # Enable -Wextra for chromium_code when we control the compiler. 1072 # Enable -Wextra for chromium_code when we control the compiler.
1062 cflags += [ "-Wextra" ] 1073 cflags += [ "-Wextra" ]
1063 } 1074 }
1064 1075
1065 # In Chromium code, we define __STDC_foo_MACROS in order to get the 1076 # In Chromium code, we define __STDC_foo_MACROS in order to get the
1066 # C99 macros on Mac and Linux. 1077 # C99 macros on Mac and Linux.
1067 defines = [ 1078 defines = [
1068 "__STDC_CONSTANT_MACROS", 1079 "__STDC_CONSTANT_MACROS",
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 ] 1116 ]
1106 defines += [ 1117 defines += [
1107 "_CRT_NONSTDC_NO_WARNINGS", 1118 "_CRT_NONSTDC_NO_WARNINGS",
1108 "_CRT_NONSTDC_NO_DEPRECATE", 1119 "_CRT_NONSTDC_NO_DEPRECATE",
1109 ] 1120 ]
1110 } else { 1121 } else {
1111 # GCC may emit unsuppressible warnings so don't add -Werror for no chromium 1122 # GCC may emit unsuppressible warnings so don't add -Werror for no chromium
1112 # code. crbug.com/589724 1123 # code. crbug.com/589724
1113 if (treat_warnings_as_errors && is_clang) { 1124 if (treat_warnings_as_errors && is_clang) {
1114 cflags += [ "-Werror" ] 1125 cflags += [ "-Werror" ]
1126
1127 # TODO(thakis): Enable this in use_custom_libcxx (asan) builds.
1128 # TODO(thakis): Enable this in chromecast builds.
1129 if (!use_custom_libcxx && !is_chromecast) {
1130 ldflags = [ "-Werror" ]
1131 }
1115 } 1132 }
1116 if (is_clang && !is_nacl) { 1133 if (is_clang && !is_nacl) {
1117 # TODO(thakis): Remove !is_nacl once 1134 # TODO(thakis): Remove !is_nacl once
1118 # https://codereview.webrtc.org/1552863002/ made its way into chromium. 1135 # https://codereview.webrtc.org/1552863002/ made its way into chromium.
1119 cflags += [ "-Wall" ] 1136 cflags += [ "-Wall" ]
1120 } 1137 }
1121 } 1138 }
1122 1139
1123 if (is_clang) { 1140 if (is_clang) {
1124 cflags += [ 1141 cflags += [
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 1628
1612 if (is_ios || is_mac) { 1629 if (is_ios || is_mac) {
1613 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1630 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1614 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1631 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1615 config("enable_arc") { 1632 config("enable_arc") {
1616 common_flags = [ "-fobjc-arc" ] 1633 common_flags = [ "-fobjc-arc" ]
1617 cflags_objc = common_flags 1634 cflags_objc = common_flags
1618 cflags_objcc = common_flags 1635 cflags_objcc = common_flags
1619 } 1636 }
1620 } 1637 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698