Chromium Code Reviews| 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) { |