logoalt Hacker News

Automate compile_flags for C/C++ projects on the Zig build system

31 pointsby deevuslast Wednesday at 4:28 AM5 commentsview on HN

Comments

deevuslast Wednesday at 9:05 AM

I built this after struggling with editor integration while working on a game decompilation project. Zig's build system is great for C/C++ cross-compilation, but editors couldn't find any includes.

Technical approach: The tool hooks into build.zig, extracts dependency paths from Zig's cache, and generates a compile_flags.txt that clangd understands.

Currently supports -I flags only. Planning to add -D macros and -std flags based on feedback.

Happy to answer questions about implementation details.

show 1 reply
DrNosferatulast Wednesday at 2:39 PM

Would love to decompile <3 "Screamer 2" <3

- A thought: would you care to write up a tutorial documenting the details of your efforts so far, so us others can try our hand at this with that reference?

It would be awesome!

show 1 reply