Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index 0f721ed7ec0e1ed515367d2cf17d3fa8ec698800..226a4fbc010334c88567eaffd23dd0bafe694edb 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -251,6 +251,11 @@ |
# Set this to true to enable SELinux support. |
'selinux%': 0, |
+ # Set this to true when building with Clang. |
+ # TODO: eventually clang should behave identically to gcc, and this |
+ # won't be necessary. |
+ 'clang%': 0, |
+ |
# Override whether we should use Breakpad on Linux. I.e. for Chrome bot. |
'linux_breakpad%': 0, |
# And if we want to dump symbols for Breakpad-enabled builds. |
@@ -1114,6 +1119,23 @@ |
], |
}]] |
}], |
+ ['clang==1', { |
+ 'cflags': [ |
+ # Don't warn about unused variables, due to a common pattern: |
+ # scoped_deleter unused_variable(&thing_to_delete); |
+ '-Wno-unused-variable', |
+ # Clang spots more unused functions. |
+ '-Wno-unused-function', |
+ # gtest confuses clang. |
+ '-Wno-bool-conversions', |
+ # Don't die on dtoa code that uses a char as an array index. |
+ '-Wno-char-subscripts', |
+ ], |
+ 'cflags!': [ |
+ # Clang doesn't seem to know know this flag. |
+ '-mfpmath=sse', |
+ ], |
+ }], |
['no_strict_aliasing==1', { |
'cflags': [ |
'-fno-strict-aliasing', |