Skip to content

Instantly share code, notes, and snippets.

@rebx
Last active October 30, 2018 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rebx/53a0f2fc97534f2e0e1efcea0383e3a5 to your computer and use it in GitHub Desktop.
Save rebx/53a0f2fc97534f2e0e1efcea0383e3a5 to your computer and use it in GitHub Desktop.
Building clang from source using ninja and ccmake
#!/bin/bash
# use the current date
curr_date=`date +%Y-%m-%d`
clang_home=~/github/llvm_${curr_date}
# exit on any error
set -e
mkdir ${clang_home}
cd ${clang_home}
git clone --depth=1 https://llvm.org/git/llvm.git
cd llvm/tools/
git clone --depth=1 https://llvm.org/git/clang.git
git clone --depth=1 https://llvm.org/git/lld.git
cd clang/tools/
git clone --depth=1 https://llvm.org/git/clang-tools-extra.git extra
cd ../../
cd ../projects/
git clone --depth=1 https://llvm.org/git/libcxx.git
git clone --depth=1 https://llvm.org/git/libcxxabi.git
git clone --depth=1 https://llvm.org/git/compiler-rt.git
cd ../../
mkdir build
cd build
# this launches the ccmake gui
ccmake -G Ninja ../llvm/
ninja
ninja install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment