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

Unified 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, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index c4d61e2281a7662b4a3ca17b8fe92dac7d15469b..8a9cb9f5c6d005f53402ad1b2977ab94c95d6fa4 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -4,8 +4,10 @@
import("//build/config/android/config.gni")
import("//build/config/chrome_build.gni")
+import("//build/config/chromecast_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/nacl/config.gni")
+import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/cc_wrapper.gni")
import("//build/toolchain/toolchain.gni")
import("//build_overrides/build.gni")
@@ -1056,6 +1058,15 @@ config("chromium_code") {
cflags = [ "-Wall" ]
if (treat_warnings_as_errors) {
cflags += [ "-Werror" ]
+
+ # The compiler driver can sometimes (rarely) emit warnings before calling
+ # the actual linker. Make sure these warnings are treated as errors as
+ # well.
+ # TODO(thakis): Enable this in use_custom_libcxx (asan) builds.
+ # TODO(thakis): Enable this in chromecast builds.
+ if (!use_custom_libcxx && !is_chromecast) {
+ ldflags = [ "-Werror" ]
+ }
}
if (is_clang) {
# Enable -Wextra for chromium_code when we control the compiler.
@@ -1112,6 +1123,12 @@ config("no_chromium_code") {
# code. crbug.com/589724
if (treat_warnings_as_errors && is_clang) {
cflags += [ "-Werror" ]
+
+ # TODO(thakis): Enable this in use_custom_libcxx (asan) builds.
+ # TODO(thakis): Enable this in chromecast builds.
+ if (!use_custom_libcxx && !is_chromecast) {
+ ldflags = [ "-Werror" ]
+ }
}
if (is_clang && !is_nacl) {
# TODO(thakis): Remove !is_nacl once
« 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