This is an archive of the discontinued LLVM Phabricator instance.

[CMake] [Darwin] Add support for generating Xcode-compatible toolchains that xcodebuild and xcrun can search
ClosedPublic

Authored by beanz on Oct 9 2015, 2:00 PM.

Details

Summary

Sometimes you want to install a custom compiler and use it like the system compiler without overriding the system compiler. This patch lets you create xctoolchains that the darwin command line tools can use.

To use this patch set LLVM_CREATE_XCODE_TOOLCHAIN=On in your CMake invocation and build the install-code-toolchain target.

After installation you can set the envar EXTERNAL_TOOLCHAINS_DIR to your installed Toolchains directory, and the TOOLCHAINS envar to the toolchain identifier (ex org.llvm.3.8.0svn). This will then cause /usr/bin/clang to call your newly installed clang.

Diff Detail

Repository
rL LLVM

Event Timeline

beanz updated this revision to Diff 36988.Oct 9 2015, 2:00 PM
beanz retitled this revision from to [CMake] [Darwin] Add support for generating Xcode-compatible toolchains that xcodebuild and xcrun can search.
beanz updated this object.
beanz added a reviewer: Bigcheese.
beanz added a subscriber: llvm-commits.
beanz updated this revision to Diff 37500.Oct 15 2015, 11:11 AM

Updates based on feedback from bogner.

This revision was automatically updated to reflect the committed changes.