[cfe-dev] CompilationDatabase support added to libclang and python binding

Arnaud de Grandmaison arnaud.allarddegrandmaison at parrot.com
Tue Jun 12 02:44:16 PDT 2012


Hi David,

>From what I can see in the cmake sources, directory is the working
directory, i.e. the place where the compiler must be invoked from. For
cmake, directory and file are absolute pathes. But I do not know how
much of a contract this is.

Multiple compilation commands can happen in some cases : for example
varying some defines to enable different part of the file (think
tablegen'erated files), or different other compile options in case
multiple builds are done at the same time (debug, release, ...).

Cheers,
--
Arnaud de Grandmaison

On 06/12/2012 10:13 AM, David Röthlisberger wrote:
> First of all, thanks Arnaud for this work, I'm going to be making use of it soon!
>
> Second, and this isn't directly related to your patch, but: Could we please have some documentation on the format of the compile_commands.json? (Manuel?). I couldn't find anything in the cmake docs. In particular, what is the "directory" supposed to be -- the root of your source directory? If you have a "recursive make" build system, would "directory" be the directory of the innermost invocation of make? Or simply the $PWD for the invocation of "command"? (this can differ from make's $PWD if the recipe explicitly contained a "cd"). Can "file" be a relative path from that directory?
>
> Finally, what is the meaning of having multiple compilation commands for a single file?
>
> Cheers
> Dave.
>
>
>


-- 
Arnaud de Grandmaison




More information about the cfe-dev mailing list