Open robbert-vdh opened 3 years ago
EDIT: This comment is wrong' see my new comment below.
We do have an introspection API that always has the "correct" information for external tooling. It should be possible (with a bit of python) to automatically generate a working compile_commands.json
from this.
So, we could implement something like this, but we already have an existing API and we just run ninja -t compdb <some fancy args>
to generate the compile_commands.json
. I wouldn't place this very high on our TODO list...
Err... intro-targets.json just contains the same unity info, naturally, since that is the "info about the build" and is correct for building the project, introspection or not. Not sure what you meant here?
Ok nevermind I forgot to run meson --reconfigure
when switching to unity=on
in my current project, so the *.json
files weren't updated...
Hi,
I'm not sure if this counts as a bug report or a feature request (since this is technically the correct behaviour). I was considering enabling unity builds on in my projects to speed up compiles, but then I realized that doing so causes the
compile_commands.json
compilation database to only contain the build commands for the unity build. This makes sense, but it also breaks all clang based tooling since all information about the original source files is now lost. Would it be possible to have Meson output the normal non-unity compilation database when using unity builds? Feel free to close this if this is out of scope or if it's too difficult to implement with Meson's current internals.