- Git
- Visual Studio with C++ development toolchain installed
All these steps (maybe apart from 1.) must be run in Developer Command Prompt for VS
- Clone LLVM repo
# Specify the release using --branch
git clone --config core.autocrlf=false --depth 1 --branch llvmorg-16.0.6 https://github.com/llvm/llvm-project.git
cd llvm-project
- Configure the build with CMake
# You can add `-DLLVM_ENABLE_PROJECTS="..."` to also compile other tools, e.g. clang, lld.
# Remember to change `-DCMAKE_INSTALL_PREFIX` to a real path
cmake -S llvm -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_HOST_TRIPLE="x86_64-pc-windows-msvc" -DCMAKE_INSTALL_PREFIX="C:\some\path\for\llvm\binaries" -DLLVM_ENABLE_ASSERTIONS=ON
- Build and test LLVM
# Use check-'tool' for other tools like clang
ninja -C build check-llvm
- Install
ninja -C build install
- Add the path from CMAKE_INSTALL_PREFIX to the PATH