Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Last active December 28, 2018 12:46
Show Gist options
  • Save tetsuok/f2844a060e7135021387 to your computer and use it in GitHub Desktop.
Save tetsuok/f2844a060e7135021387 to your computer and use it in GitHub Desktop.
Compile Clang/LLVM

Setup

$ brew install cmake
$ brew install ninja

Getting the source

$ git clone http://llvm.org/git/llvm.git
$ cd llvm/tools
$ git clone http://llvm.org/git/clang.git
$ cd clang/tools
$ git clone http://llvm.org/git/clang-tools-extra.git extra
$ cd ../../..
$ cd projects
$ git clone http://llvm.org/git/compiler-rt.git

Build

$ cd /path/to/llvm
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=$HOME/local -G "Ninja" ..
$ ninja
$ ninja clang-test
$ ninja install
@MiguelNdeCarvalho
Copy link

I am getting error when using cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=$HOME/local -G "Ninja" .. Thanks :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment