Remove comment header from generated output of Build.ConfigHeader
Zig Version
0.12.0-dev.3161+377ecc6af
Steps to Reproduce and Observed Behavior
When using b.addConfigHeader() in build.zig, a C or ASM comment is forcefully prepended in the generated output file ; from ConfigHeader.zig:
const header_text = "This file was generated by ConfigHeader using the Zig Build System.";
const c_generated_line = "/* " ++ header_text ++ " */\n";
const asm_generated_line = "; " ++ header_text ++ "\n";
...
try output.appendSlice(c_generated_line);
I use ConfigHeader with an existing lua.in file to generate a Lua file, as I'm migrating from CMake to build.zig, and in Lua /* */ or ; comments are invalid. Can you add an option to customize and remove this automatically added comment ?
Expected Behavior
I would like no extra text added to the generated file of ConfigHeader.
Real-world example here: https://github.com/g012/l65/blob/master/build.zig
Sure, go ahead and add the option. This is a contributor-friendly enhancement.
@andrewrk #20018 This should solve the issue. It implements some suggestions from https://github.com/ziglang/zig/pull/19277#pullrequestreview-2032869151