[cfe-dev] clang libTooling instructions say that cmake is required to build the tools and clang?
klimek at google.com
Thu Apr 25 04:12:06 PDT 2013
On Thu, Apr 25, 2013 at 11:05 AM, Gábor Kozár <kozargabor at gmail.com> wrote:
> 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
> 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.
Technically you don't even need the compilation database (although it makes
things much easier). For tools built according to the standard pattern, you
can run them with
$ mytool some/file.cc -- <compile command line args go here>
That said, cmake+ninja gives you a faster build (and an even faster
parallel build), so I personally always prefer to build with cmake+ninja
> 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 install
>> The libtooling instructions here say that to use libtooling, you have to
>> build clang using CMake:
>> 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?
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev