[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create compile_commands.json for integration with other build system

From: Duane Griffin
Subject: Re: Create compile_commands.json for integration with other build systems and IDEs
Date: Mon, 30 Jul 2018 16:25:54 +1200

On Mon, Jul 30, 2018 at 11:26 AM, Paul Smith <address@hidden> wrote:
> On Mon, 2018-07-30 at 10:44 +1200, Duane Griffin wrote:
>> I am not a GNU make developer but I am pretty sure that it is not
>> possible to do this generically within make itself. Make does not
>> work at that level. It just runs shell code, it doesn't understand
>> that a particular command is, for example, invoking clang and should
>> be added to a compilation database.
> Is it really critical that only compilation commands be added to
> compile_commands.json?  What would be the impact if other commands
> (that had recipes) were also added?

Actually that would probably be fine: the tools seem to just ignore
the dummy entry we add at the end (I don't use this tooling myself,
but I haven't heard any complaints from the devs that do).

However, as you say, all the other stuff that happens in recipes is
more problematic.

Anyway, as I said, in order for makefiles to know what needs to be
recompiled when (e.g.) compiler flags change it has to be storing the
full compile command, or functional equivalent, somewhere already.
That is the same information you need to write to the database, so
from there it is just a matter of collecting it up and writing it out.


"I never could learn to drink that blood and call it wine" - Bob Dylan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]