Skip to content

Instantly share code, notes, and snippets.

@lefticus
Last active August 22, 2023 22:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lefticus/d2069c0284d12a5882d85c78a890f5b8 to your computer and use it in GitHub Desktop.
Save lefticus/d2069c0284d12a5882d85c78a890f5b8 to your computer and use it in GitHub Desktop.
A script for building LLVM
if [ $# -gt 1 ]
then
echo "Checking out LLVM '$1' branch from svn into '`pwd`/llvm' and setting install prefix to '$2'"
echo "Press Return To Continue"
read $VAR
else
echo "Usage: $0 <branch name> <install prefix>"
exit
fi
git clone https://github.com/llvm/llvm-project.git
mkdir -p llvm-build
pushd llvm-build
CXX=$COMPILER cmake -G "Ninja" ../llvm-project/llvm -DCMAKE_BUILD_TYPE:STRING=Release -DLLVM_ENABLE_PROJECTS:STRING=clang -DCMAKE_INSTALL_PREFIX:PATH=$2 -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON -DLLVM_CCACHE_BUILD:BOOL=ON
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment