Commit 34f4089a authored by thakis@chromium.org's avatar thakis@chromium.org

Set CC to clang when GYP_DEFINES=clang=1.

This makes it a lot easier to build with clang, since setting the GYP_DEFINES
is now the only thing one has to do. The rest is set automatically.
In preparation of setting clang=1 in build/common.gypi on mac.

Depends on http://codereview.chromium.org/7779041/ . Idea and xcode
part of the patch by Mark.

BUG=none
TEST= Set GYP_DEFINES=clang=1, create xcode and make projects
1.) Building with Xcode 3.2 uses clang
2.) Building with Xcode 4 gives functional fixits
3.) Building with make uses clang both for host and target
4.) Building with xcodebuild and goma still works on mac
5.) Building with make and goma still works

Review URL: http://codereview.chromium.org/7779039

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99835 0039d316-1c4b-4281-b951-d872f2087c98
parent d70cc13b
...@@ -1668,6 +1668,9 @@ ...@@ -1668,6 +1668,9 @@
{'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'} {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
], ],
['clang==1', { ['clang==1', {
'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'WARNING_CFLAGS': [ 'WARNING_CFLAGS': [
'-Wheader-hygiene', '-Wheader-hygiene',
# Don't die on dtoa code that uses a char as an array index. # Don't die on dtoa code that uses a char as an array index.
...@@ -1695,6 +1698,13 @@ ...@@ -1695,6 +1698,13 @@
}], }],
], ],
}, },
'conditions': [
['clang==1', {
'variables': {
'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
},
}],
],
'target_conditions': [ 'target_conditions': [
['_type!="static_library"', { ['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
...@@ -2002,6 +2012,16 @@ ...@@ -2002,6 +2012,16 @@
], ],
}, },
}], }],
['clang==1', {
'make_global_settings': [
['CC', 'third_party/llvm-build/Release+Asserts/bin/clang'],
['CXX', 'third_party/llvm-build/Release+Asserts/bin/clang++'],
['LINK', 'third_party/llvm-build/Release+Asserts/bin/clang++'],
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
['LINK.host', '$(LINK)'],
],
}],
], ],
'xcode_settings': { 'xcode_settings': {
# DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment