Latest Clang location in XCode 4.5

2019-02-15 18:06发布

问题:

I've updated XCode to 4.5 (with iOS 6) and installed latest command line tools. Before that i always had the latest Clang version in

/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin

(clang and clang++ binaries), but now, with the last update, they are gone and i only have gcc and llvm stuff. I've checked 'clang' bins all over my Mac and found one in

/Applications/XCode.app/Contents/Developer/Toolchains/XCodeDefault.xctoolchain/usr/bin

But why so? First, why i have no clang in previous folder, where it always was, and second, it is the valid way to use as 'default location for clang' this xctoolchain folder (e.g., for cmake in project repository)

EDIT: for Xcode 5 and more, clang is again present in .xctoolchain folder

回答1:

If you installed the "command line tools for Xcode" you would have clang in a nice, intuitive location like "/usr/bin".

To get at them, you can go in via Xcode's preferences like this:

or you can click the "Looking for additional developer tools" link at http://developer.apple.com/xcode, where there's a disk image and an installer you can download.

Both of these options install the exact same components.