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

Unified Diff: build/config/compiler/BUILD.gn

Issue 1422463013: Allow disabling warnings as errors in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 4d3c6ba0c09093bd5137cd32c4d37cdee1db6d40..754663520eadc9ac10e1b5f52dceee3ca7463bae 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -22,6 +22,11 @@ if (is_win) {
}
declare_args() {
+ # Default to warnings as errors for default workflow, where we catch
+ # warnings with known toolchains. Allow overriding this e.g. for Chromium
+ # builds on Linux that could use a different version of the compiler.
+ treat_warnings_as_errors = true
+
# Normally, Android builds are lightly optimized, even for debug builds, to
# keep binary size down. Setting this flag to true disables such optimization
android_full_debug = false
@@ -704,13 +709,16 @@ config("default_warnings") {
cflags += [
# Enables.
"-Wendif-labels", # Weird old-style text after an #endif.
- "-Werror", # Warnings as errors.
# Disables.
"-Wno-missing-field-initializers", # "struct foo f = {0};"
"-Wno-unused-parameter", # Unused function parameters.
]
+ if (treat_warnings_as_errors) {
+ cflags += [ "-Werror" ]
Dirk Pranke 2015/11/06 17:56:54 Does it make sense to make this work with the othe
brettw 2015/11/09 02:25:02 Yeah, it makes sense to put this check around the
+ }
+
if (is_mac) {
cflags += [ "-Wnewline-eof" ]
if (!is_nacl) {
« 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