-
Notifications
You must be signed in to change notification settings - Fork 12
Build LLVM with MSYS2
valtron edited this page Jul 20, 2018
·
2 revisions
It's easier to install LLVM with pacman
rather than building it yourself: pacman -S mingw64/mingw-w64-x86_64-llvm
.
This assumes you have set up MSYS2.
To build LLVM:
- Using
pacman
, install:mingw64/mingw-w64-x86_64-make
mingw64/mingw-w64-x86_64-gcc
mingw64/mingw-w64-x86_64-cmake
- Download LLVM source and uncompress to folder
$LLVMSRC
- Create folder
$LLVMBUILD
and createbuild.sh
containing:PATH="/c/Windows/system32:/d/dev/msys64/mingw64/bin" LLVMSRC="/d/dev/llvm-4.0.0.src" LLVMINS="/d/dev/llvm/llvm-4.0" cmake \ -G "MinGW Makefiles" \ -DCMAKE_INSTALL_PREFIX="$LLVMINS" \ -DCMAKE_BUILD_TYPE="Release" \ -DLLVM_TARGETS_TO_BUILD="X86" \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_ENABLE_CXX1Y=ON \ -DLLVM_ENABLE_ASSERTIONS=ON \ -DSPHINX_OUTPUT_HTML=OFF \ -DSPHINX_OUTPUT_MAN=OFF \ "$LLVMSRC" cmake --build . cmake --build . --target install
- Customize the paths in
build.sh
accordingly - Customize the
LLVM_*
options according to your needs; they're documented here - The list of backends for
LLVM_TARGETS_TO_BUILD
is in$LLVMSRC/CMakeLists.txt
, nearset(LLVM_ALL_TARGETS
. Note:CppBackend
was removed in 3.9 :( -
cd
into$LLVMBUILD
sh build.sh