[cfe-dev] clang libTooling instructions say that cmake is required to build the tools and clang?

Gábor Kozár kozargabor at gmail.com
Thu Apr 25 02:05:50 PDT 2013


Hi,

I believe you are correct. I'm certain that for LLVM and Clang is
absolutely does not matter how you build them (in different circumstances,
I built them with both methods). However, Clang tools require a
CompilationDatabase, which can either be populated manually from other
sources (where I work, we use a custom file format for this) or from the
somewhat more convenient JSON compilation database that CMake is able to
generate automatically. (There also exists another tool which is capable of
generating such a .json file even when you're not using CMake - I don't
remember the name, but I found a reference to it in the Clang documentation
somewhere.)

So yeah, it does not matter how you build Clang, and neither does it matter
how you build the target application - all that matters is that you need a
CompilationDatabase for Clang to be able to work its magic.

Gabor


2013/4/25 Peeter Joot <peeter.joot at gmail.com>

> I've built and installed clang, but did so in the "typical" unix way:
>
> mkdir build
> cd build
> ../llvm/configure --prefix=...
> make
> make install
>
> The libtooling instructions here say that to use libtooling, you have to
> build clang using CMake:
>
> http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
>
> However, it appears all the libtooling stuff is already build by the make
> that I've invoked, so I wouldn't think that I have to re-build clang a
> second time to use libtooling.
>
> Is the cmake dependency for clang tools just the requirement to generate
> this compilation database (this .json file).  If so, wouldn't the
> requirement be to do this for the project code that I want to run the tools
> on, not the clang or llvm build tree itself?
>
> --
> Peeter
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130425/f9aebebf/attachment.html>


More information about the cfe-dev mailing list