Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use LLVM compiler by default for all Xcode projects?

Tags:

xcode

iphone

llvm

I really enjoy switching from gcc to LLVM compiler, but do I have to switch manually every time I start a new project, or is there any way to make LLVM the default compiler?

I'm talking about xcode 3.

Thanks.

like image 987
Chris Chen Avatar asked Mar 04 '26 12:03

Chris Chen


1 Answers

To accomplish this you will have to modify the project template within the Developer directory.

Navigate to where your templates are (probably something like: /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates/

Once you're there, you can select the project template you wish to modify, and locate it's .xcodeproj file. You can "show package contents" and inside is a project.pbxproj. You can modify this file and edit in the build setting to change the default compiler.

You'll have to find each section that relates to the build settings for each configuration (Debug, Release etc.), search for /* Begin XCBuildConfiguration section */.

Then you'll have to add GCC_VERSION as a key and com.apple.compilers.llvm.clang.1_0 as the value (1_0 in this instance is actually LLVM 1.6 according to Xcode. I also assume that the key-name GCC_VERSION only has GCC in it for legacy reasons, this will probably be updated to COMPILER_VERSION or something in the future).

Save the template and create a new project (You may have to restart Xcode if it was open). The compiler should be set to LLVM now.

However, I don't recommend you do this as LLVM still isn't 100% fit for deploying applications to users.

like image 147
Jasarien Avatar answered Mar 06 '26 00:03

Jasarien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!