Might be a noob question here, but I’ve searched online without any answers.
But when I tried this:
zig build run -Doptimize=ReleaseFast -- -fsingle-threaded
it seems not working.
Why?
Might be a noob question here, but I’ve searched online without any answers.
But when I tried this:
zig build run -Doptimize=ReleaseFast -- -fsingle-threaded
it seems not working.
Why?
Those are options that you should pass to addExecutable
Zig Documentation in your build.zig file.
Not all options are available in addExecutable
, but you can also set the options afterwards:
exe.single_threaded = true;
exe.strip = true; // Not available in addExecutable
Thanks friends. It looks build.zig
is a completely different approach to zig build-exe
.
Note that you can expose options to the user with b.option()
. These will show up in the zig build --help
menu, and then you can use normal branching logic on the values to do whatever you want with them.