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: http://src.chromium.org/svn/trunk/src/build@74479 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
thakis@chromium.org 2011-02-10 21:03:35 +00:00
Родитель bf35a0e000
Коммит 5a3db455de
1 изменённых файлов: 26 добавлений и 20 удалений

Просмотреть файл

@ -1187,28 +1187,34 @@
}]] }]]
}], }],
['clang==1', { ['clang==1', {
'cflags': [ 'target_conditions': [
# Clang spots more unused functions. ['_toolset=="target"', {
'-Wno-unused-function', 'cflags': [
# Don't die on dtoa code that uses a char as an array index. # Clang spots more unused functions.
'-Wno-char-subscripts', '-Wno-unused-function',
# Survive EXPECT_EQ(unnamed_enum, unsigned int) -- see # Don't die on dtoa code that uses a char as an array index.
# http://code.google.com/p/googletest/source/detail?r=446 . '-Wno-char-subscripts',
# TODO(thakis): Use -isystem instead (http://crbug.com/58751 ). # Survive EXPECT_EQ(unnamed_enum, unsigned int) -- see
'-Wno-unnamed-type-template-args', # http://code.google.com/p/googletest/source/detail?r=446 .
# TODO(thakis): Turn on -- http://crbug.com/72205 # TODO(thakis): Use -isystem instead (http://crbug.com/58751 )
'-Wno-overloaded-virtual', '-Wno-unnamed-type-template-args',
], # TODO(thakis): Turn on -- http://crbug.com/72205
'cflags!': [ '-Wno-overloaded-virtual',
# Clang doesn't seem to know know this flag. ],
'-mfpmath=sse', 'cflags!': [
], # Clang doesn't seem to know know this flag.
'-mfpmath=sse',
],
}]],
}], }],
['clang==1 and clang_load!="" and clang_add_plugin!=""', { ['clang==1 and clang_load!="" and clang_add_plugin!=""', {
'cflags': [ 'target_conditions': [
'-Xclang', '-load', '-Xclang', '<(clang_load)', ['_toolset=="target"', {
'-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)', 'cflags': [
], '-Xclang', '-load', '-Xclang', '<(clang_load)',
'-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
],
}]],
}], }],
['no_strict_aliasing==1', { ['no_strict_aliasing==1', {
'cflags': [ 'cflags': [