[cfe-dev] [cfe-commits] Design proposal: Add custom compilation database formats as plugins

Chandler Carruth chandlerc at google.com
Wed Jul 18 14:54:13 PDT 2012


On Wed, Jul 18, 2012 at 2:45 PM, Sean Silva <silvas at purdue.edu> wrote:

> I was looking at adding compilation database support for ninja build
> files. However, I ran into the problem that it basically amounted to
> rewriting the entire ninja build file parser that is already
> implemented inside of ninja. As such, it seems like the very nature of
> compilation databases is something that needs to be output by the tool
> configuring/doing the build.
>
> Is your thought with this that, for example, ninja would provide a
> compilation database plugin reusing its own parser?
>

For ninja in particular, I have long thought that the correct approach is
to write something which can convert 'ninja -t commands' into the JSON
format, or to build a tool for writing the JSON database directly into
ninja. Then CMake (or anything else that generates the build file) can
inject targets to automatically generate and update this file. This
includes re-building generated source files as necessary.

I think for OSS build systems and systems that are largely
command-line-driven like ninja, the file output and interchange system is a
much better alternative. The plugin support I think is mostly useful for
stateful build systems which may really need to implement the database
using custom logic.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120718/a8e84de1/attachment.html>


More information about the cfe-dev mailing list