looking to write a simple program that generates a module to be included in another module and i'm looking at how options work as a sample... https://github.com/ziglang/zig/blob/1c9bb6a79de3ca52d819177fea32ce7993634e31/lib/std/Build/Step/Options.zig#L428-L496 do you really need to manually generate a filename? this is like 80 lines of boilerplate. i just want to have a program that generates module sources and include it somewhere else
#quick & dirty module generation with zig build
1 messages · Page 1 of 1 (latest)
- create a zig program that generates code and prints it to stdout
- build that program as an artifact
- invoke it with
b.addRunArtifact, capturing its output as a generated file viarun.captureStdOut() - provide that generated file path as the root source file to the module
too used to reading source code in lieu of docs oops