Using LLVM Clang 2.6 with Xcode 3.2

↘锁芯ラ 提交于 2019-12-09 05:14:11

问题


So, I've just downloaded the LLVM Clang (2.6) binaries.
Mac OS X 10.6 comes with Clang 1.0.

Do you know how to integrate a later version of Clang with the Xcode 3.2.x IDE?


Just overwriting files seems a little bit risky.


回答1:


First off – you're referring to clang 1.0 based on LLVM 2.6. There is no clang 2.6, only a clang 1.0 based on LLVM 2.6. The clang issued with LLVM 2.6 is the same as the one with Xcode 3.2. (see Wikipedia: "On October 23, 2009 Clang 1.0 was released along with LLVM 2.6 for the first time"; I also know this from personal experience).

Secondly – you can integrate any version of clang, even one you build from clang's SVN. To do so, I have a .xcconfig file (a plain text file with the .xcconfig suffix) with two settings included:

GCC_VERSION = com.apple.compilers.llvm.clang.1_0
CC = /Users/jpo/Development/oss/llvm/Debug/bin/clang

Then, I add the xcconfig file to my project (because it contains some other warnings I like to turn on, such as the ones Peter Hosey recommends). Then, in the bottom right of the build settings tab for my project I tell it to be 'Based on' the name of my xcconfig file.

This all works out great, because then you can just keep the files from clang SVN in a directory on your drive, and build it, and your Xcode projects will use always use your latest built version since it always will be at that path. Of course, building clang itself is a time-consuming process, but its still really, really, cool to be using bleeding-edge technology.




回答2:


So, dont overwrite! Rename them to their respective version (e.g. clang-1.0), then create a symbolic link to the one you want. If something goes wrong, you can switch it to the original version.

/Developer/usr/bin .. in case you dont know where the bins are.



来源:https://stackoverflow.com/questions/1718597/using-llvm-clang-2-6-with-xcode-3-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!