Last active
August 28, 2023 03:02
-
-
Save marler8997/9d1ec6c687299c169a710a7843368263 to your computer and use it in GitHub Desktop.
Build LLVM for Zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -ex | |
prefix=$HOME/llvm16-debug | |
# LLVM | |
mkdir -p llvm/out-debug | |
if [ ! -e llvm/out-debug/build.ninja ]; then | |
cmake -S llvm -B llvm/out-debug \ | |
-DCMAKE_INSTALL_PREFIX=$prefix \ | |
-DCMAKE_PREFIX_PATH=$prefix \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DLLVM_ENABLE_LIBXML2=OFF \ | |
-DLLVM_ENABLE_TERMINFO=OFF \ | |
-DLLVM_PARALLEL_LINK_JOBS=1 \ | |
-G Ninja | |
fi | |
ninja -C llvm/out-debug install | |
## LLD | |
mkdir -p lld/out-debug | |
if [ ! -e lld/out-debug/build.ninja ]; then | |
cmake -S lld -B lld/out-debug \ | |
-DCMAKE_INSTALL_PREFIX=$prefix \ | |
-DCMAKE_PREFIX_PATH=$prefix \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DLLVM_PARALLEL_LINK_JOBS=1 \ | |
-DCMAKE_CXX_STANDARD=17 \ | |
-G Ninja | |
fi | |
ninja -C lld/out-debug install | |
# Clang | |
mkdir -p clang/out-debug | |
if [ ! -e clang/out-debug/build.ninja ]; then | |
cmake -S clang -B clang/out-debug \ | |
-DCMAKE_INSTALL_PREFIX=$prefix \ | |
-DCMAKE_PREFIX_PATH=$prefix \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DLLVM_PARALLEL_LINK_JOBS=1 \ | |
-G Ninja | |
fi | |
ninja -C clang/out-debug install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -ex | |
prefix=$HOME/llvm16-release | |
mkdir -p llvm/out-release | |
if [ ! -e llvm/out-release/build.ninja ]; then | |
cmake -S llvm -B llvm/out-release \ | |
-DCMAKE_INSTALL_PREFIX=$prefix \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DLLVM_ENABLE_PROJECTS="lld;clang" \ | |
-DLLVM_ENABLE_LIBXML2=OFF \ | |
-DLLVM_ENABLE_TERMINFO=OFF \ | |
-DLLVM_ENABLE_LIBEDIT=OFF \ | |
-DLLVM_ENABLE_ASSERTIONS=ON \ | |
-DLLVM_PARALLEL_LINK_JOBS=1 \ | |
-G Ninja | |
fi | |
ninja -C llvm/out-release install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment