[cfe-dev] clang - getting started with git

Sean Silva silvas at purdue.edu
Mon Jul 9 21:43:23 PDT 2012


here is how I setup my dev environment from scratch:

first I search google for "llvm git", because I can never remember the
git mirror's address. This takes me to
http://llvm.org/docs/GettingStarted.html#git_mirror

then here's what I do (I'm doing this for real as I'm typing this):

$ mkdir llvm
$ cd llvm
$ git clone http://llvm.org/git/llvm.git
$ mv llvm source
$ cd source/tools
$ git clone http://llvm.org/git/clang.git
$ cd ../../
$ mkdir debug+asserts
$ cd debug+asserts
$ cmake -G Ninja ../source -DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_ASSERTIONS=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
$ ninja

You should now be building LLVM/Clang :-)

A few notes:
You'll need a pretty recent CMake (>=2.8.8 IIRC). If you're on Mac,
you will need to build from source to enable Ninja since CMake doesn't
enable ninja "by default" on mac. You can force it to enable ninja by
passing in a special flag (IIRC it is -DCMAKE_ENABLE_NINJA).
I usually just build ninja from scratch (clone
<https://github.com/martine/ninja>).

I hope that helps.
--Sean Silva

On Mon, Jul 9, 2012 at 5:50 PM, Thiago Farina <tfarina at chromium.org> wrote:
> Hi,
>
> Are there instruction for checking out/compiling clang with git
> instead of svn? Is it possible to build clang with ninja instead of
> make?
>
> The getting started doc is for svn - http://clang.llvm.org/get_started.html
>
> --
> Thiago
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list