Skip to content

generate compile_commands.json#941

Merged
pkova merged 6 commits into
developfrom
dozreg/compile-commands
Jan 12, 2026
Merged

generate compile_commands.json#941
pkova merged 6 commits into
developfrom
dozreg/compile-commands

Conversation

@dozreg-toplud

@dozreg-toplud dozreg-toplud commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

QoL PR: you can now generate compile_commands.json file with:

zig build -Dgenerate-commands

@dozreg-toplud dozreg-toplud requested a review from a team as a code owner January 12, 2026 10:15
@matthew-levan

Copy link
Copy Markdown
Contributor

Great to see. Why is the macro definition (“-D”) required in addition to the custom build subcommand?

@dozreg-toplud

Copy link
Copy Markdown
Contributor Author

It's not a macro definition, it's a boolean flag for BuildCfg struct. The code needs to be compiled with gen-cdb-fragment-path flag to generate JSON fragments (controlled by the flag), and an extra step is needed after build to merge the fragments and clean up (hence the subcommand to invoke that step)

@matthew-levan

matthew-levan commented Jan 12, 2026 via email

Copy link
Copy Markdown
Contributor

@dozreg-toplud

Copy link
Copy Markdown
Contributor Author

now only the flag is necessary

@pkova pkova merged commit 406c18f into develop Jan 12, 2026
2 checks passed
@pkova pkova deleted the dozreg/compile-commands branch January 12, 2026 16:12
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.

3 participants