summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-10 21:03:35 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-10 21:03:35 +0000
commit3e40c8893a8e0061f68a05c483eb2ec047fa0510 (patch)
treee95f57073c6bbbaf533470fc642ce23f1b7e1b84 /build
parent7b8d4a285f8acfada8d6c90904c4ac3f5558bd44 (diff)
downloadchromium_src-3e40c8893a8e0061f68a05c483eb2ec047fa0510.zip
chromium_src-3e40c8893a8e0061f68a05c483eb2ec047fa0510.tar.gz
chromium_src-3e40c8893a8e0061f68a05c483eb2ec047fa0510.tar.bz2
clang: Set clang-specific flags on linux only if the target compiler is used.
The host compiler is hardcoded to gcc in the linux make build, and gcc does not understand all of these options. BUG=none TEST=none Review URL: http://codereview.chromium.org/6487005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/common.gypi46
1 files changed, 26 insertions, 20 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 23a4753..d341485 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1187,28 +1187,34 @@
}]]
}],
['clang==1', {
- 'cflags': [
- # Clang spots more unused functions.
- '-Wno-unused-function',
- # Don't die on dtoa code that uses a char as an array index.
- '-Wno-char-subscripts',
- # Survive EXPECT_EQ(unnamed_enum, unsigned int) -- see
- # http://code.google.com/p/googletest/source/detail?r=446 .
- # TODO(thakis): Use -isystem instead (http://crbug.com/58751 ).
- '-Wno-unnamed-type-template-args',
- # TODO(thakis): Turn on -- http://crbug.com/72205
- '-Wno-overloaded-virtual',
- ],
- 'cflags!': [
- # Clang doesn't seem to know know this flag.
- '-mfpmath=sse',
- ],
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'cflags': [
+ # Clang spots more unused functions.
+ '-Wno-unused-function',
+ # Don't die on dtoa code that uses a char as an array index.
+ '-Wno-char-subscripts',
+ # Survive EXPECT_EQ(unnamed_enum, unsigned int) -- see
+ # http://code.google.com/p/googletest/source/detail?r=446 .
+ # TODO(thakis): Use -isystem instead (http://crbug.com/58751 )
+ '-Wno-unnamed-type-template-args',
+ # TODO(thakis): Turn on -- http://crbug.com/72205
+ '-Wno-overloaded-virtual',
+ ],
+ 'cflags!': [
+ # Clang doesn't seem to know know this flag.
+ '-mfpmath=sse',
+ ],
+ }]],
}],
['clang==1 and clang_load!="" and clang_add_plugin!=""', {
- 'cflags': [
- '-Xclang', '-load', '-Xclang', '<(clang_load)',
- '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
- ],
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'cflags': [
+ '-Xclang', '-load', '-Xclang', '<(clang_load)',
+ '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
+ ],
+ }]],
}],
['no_strict_aliasing==1', {
'cflags': [