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

Stephen Kelly steveire at gmail.com
Tue Jun 19 00:15:11 PDT 2012

Manuel Klimek wrote:

> On Tue, Jun 12, 2012 at 12:11 PM, Chandler Carruth
> <chandlerc at google.com>wrote:
>> On Tue, Jun 12, 2012 at 1:13 AM, David Röthlisberger
>> <david at rothlis.net>wrote:
>>> Could we please have some documentation on the format of the
>>> compile_commands.json? (Manuel?).
>> Just wanted to second this. I actually wanted to cite just such
>> documentation in a new design proposal I'm about to mail out... =D
> Committed as r158365.
> http://clang.llvm.org/docs/JSONCompilationDatabase.html
> Feeback or patches welcome :)
> Cheers,
> /Manuel

The tooling doesn't seem to handle relative paths very well.

If I have the directory /foo/bar and a build directory /foo/bar/build, and 
the compile_commands.json contains entries like "../blub.cpp", the tooling 
seems to not find the entry for blub.cpp.

I fixed that for the Ninja generator in CMake here:


but I think this might be a bug in clang (recall I brought up relative paths 
troubles yesterday too :)).



More information about the cfe-dev mailing list