summaryrefslogtreecommitdiffstats
path: root/build/common.gypi
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 21:53:30 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 21:53:30 +0000
commit34f4089a8eb2f83033a26e8a959b4a6899f39085 (patch)
treeec2db0a389edae899a49da9dea69532780c6e52a /build/common.gypi
parentd70cc13b5494df4c1598c1c22b7377366fea25b9 (diff)
downloadchromium_src-34f4089a8eb2f83033a26e8a959b4a6899f39085.zip
chromium_src-34f4089a8eb2f83033a26e8a959b4a6899f39085.tar.gz
chromium_src-34f4089a8eb2f83033a26e8a959b4a6899f39085.tar.bz2
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
Diffstat (limited to 'build/common.gypi')
-rw-r--r--build/common.gypi20
1 files changed, 20 insertions, 0 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 007b908..5e1171a 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1668,6 +1668,9 @@
{'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
],
['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': [
'-Wheader-hygiene',
# Don't die on dtoa code that uses a char as an array index.
@@ -1695,6 +1698,13 @@
}],
],
},
+ 'conditions': [
+ ['clang==1', {
+ 'variables': {
+ 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
+ },
+ }],
+ ],
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
@@ -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': {
# DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!