下载
git clone https://github.com/llvm/llvm-project.git
git clone --config core.autocrlf=false https://github.com.cnpmjs.org/llvm/llvm-project.git
编译
mkdir build
cmake -B build -S llvm -G Ninja -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;" -DCMAKE_BUILD_TYPE=Release
cd ninja
ninja
ninja install
mkdir build
cmake -B build -S llvm -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;" -DCMAKE_BUILD_TYPE=Release
cd build
make -j8
make install DESTDIR=$HOME/.llvm/install
参考