The goal is to make the ClangCompile buildstep in the Housekeeping bot turn red if there is a warning.
Review URL: https://codereview.appspot.com/6868055

git-svn-id: http://skia.googlecode.com/svn/trunk@6674 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index 6d1a4f8..332d342 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -125,6 +125,11 @@
           '-Wno-c++11-extensions'
         ],
         'conditions' : [
+          ['skia_warnings_as_errors == 1', {
+            'cflags': [
+              '-Werror',
+            ],
+          }],
           ['skia_arch_width == 64', {
             'cflags': [
               '-m64',
@@ -290,6 +295,11 @@
           '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
         ],
         'conditions': [
+          [ 'skia_warnings_as_errors == 1', {
+            'cflags': [
+              '-Werror',
+            ],
+          }],
           [ 'skia_profile_enabled == 1', {
             'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
           }],
diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi
index 1c900c5..042340b 100644
--- a/gyp/common_variables.gypi
+++ b/gyp/common_variables.gypi
@@ -87,6 +87,9 @@
       'skia_gpu%': 1,
       'skia_osx_sdkroot%': 'macosx',
       'skia_profile_enabled%': 0,
+      # Note: This is currently only turned on for linux and android.
+      # TODO: Turn on for Win and Mac as well.
+      'skia_warnings_as_errors%': 0,
     },
 
     # Re-define all variables defined within the level-2 'variables' dict,
@@ -106,6 +109,7 @@
     'skia_gpu%': '<(skia_gpu)',
     'skia_osx_sdkroot%': '<(skia_osx_sdkroot)',
     'skia_profile_enabled%': '<(skia_profile_enabled)',
+    'skia_warnings_as_errors%': '<(skia_warnings_as_errors)',
     'skia_static_initializers%': '<(skia_static_initializers)',
     'ios_sdk_version%': '6.0',