Assume LLVM Source tree is located at ../LLVM
The -DLLVM_CREATE_XCODE_TOOLCHAIN=on
is only useful for macOS users that requires an Xcode Toolchain to use within Xcode.
This enables an extra target called install-xcode-toolchain
.
Add -DCMAKE_INSTALL_PREFIX=~/Library/Developer/
installs the Toolchain for the current user.
To install the toolchain globally, replace with -DCMAKE_INSTALL_PREFIX=/Library/Developer/
and invoke sudo ninja install-xcode-toolchain
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DLLVM_APPEND_VC_REV=on -DLLVM_CREATE_XCODE_TOOLCHAIN=on -DCMAKE_INSTALL_PREFIX=~/Library/Developer/ ../LLVM