Re: [PATCH v2 3/3] build: add compile_commands.json target

Anthony PERARD <[email protected]>
Newsgroups gmane.comp.emulators.xen.devel
Message-ID <1786371871.8631fc262581453bbf619ec5b2062170.19fec0f92fc000e099@vates.tech>
On Mon, Aug 10, 2026 at 10:49:45AM +0100, George Dunlap wrote:
> Add a convenience target generating the compilation database from a
> built object tree, alongside the other developer conveniences (tags,
> cscope, cloc -- the last of which already walks the same .cmd files):
> 
>     make -C xen compile_commands.json
> 
> The output lands in the object tree root.  For an in-tree build,
> clangd and other consumers discover it there automatically when
> opening files; for an out-of-tree build, symlink it into the source
> tree root (consumers search the ancestors of the file being edited).
> 
> Note the database records the compiler invocations actually used.
> With a clang build it is consumable by clangd as-is; for a gcc build,
> clang-based tools may need a small .clangd configuration
> (CompileFlags: Remove/Add) dropping gcc-only flags.
> 
> Also add the generated file to .gitignore.
> 
> Assisted-by: LLM
> Signed-off-by: George Dunlap <[email protected]>

Reviewed-by: Anthony PERARD <[email protected]>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.