Skip to content

Step-style support for compile_commands.json generation #24178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GreyElaina
Copy link

Compared to #22012 and #18391, this PR introduces a new b.addCompileCommands along with the corresponding Step implementation. I believe this approach is more flexible than using -fcompdb / -fno-compdb.

The only issue is that I made this thing look ugly, and I can't think of a better way to do it.

I've simply wrapped it into a Step — the original implementation comes from the two PRs I mentioned earlier.

const compile_commands = b.addCompileCommands(b.path("compile_commands.json"));

b.getInstallStep().dependOn(&compile_commands.step);

Co-authored-by: GalaxyShard <dominic.adragna@byteroach.com>
Co-authored-by: Jonathan Barronville <jay@barronville.com>
@GreyElaina GreyElaina marked this pull request as ready for review June 14, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant