[cfe-dev] JSONCompilationDatabase additional keys

Nicholas Gill mythagel at gmail.com
Wed Sep 11 03:41:57 PDT 2013


Hello cfe-dev,

At present unknown keys in the compile_commands.json file will cause the
JSONCompilationDatabase parser to reject the file.

1. Would a patch to relax this constraint be accepted?
2. Would other consumers of the compile_commands.json be negatively
impacted by unknown keys?

The motivating example (somewhat contrived) involves a single TU built with
a different environment in two different targets

int main()
{
    TYPE i = -1;
    return i < 0;
}

cc -DTYPE=int source.c -o bin1
cc -DTYPE=uint16_t source.c -o bin2

So for my use case I'd like to add a (purely optional) target name to the
compilation database (generated via cmake) - in order to be able to provide
more accurate diagnostics to the user.

Cheers,

-nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130911/f273f72d/attachment.html>


More information about the cfe-dev mailing list