Relative Content

Tag Archive for zig

Specify output directory and binary name to zig build-exe

I struggle to find any equivalent of C compiler’s cc <srcs> -o <path/and/binary/name> in documentation of zig build-exe. Only thing that I found is option --name, but It cannot specify path, only name of unit.
Is there any way to do so in command, or using build.zig file is the only way?

How to run shell commands which require input in zig?

I want to run some shell commands in zig which asks for input. For example look at my code, I want to update packages, but that requires sudo password which I obviously cant enter. Im also ok, to just run .sh file with zig, but I want to see progress and obviously be able to input password or smth else if needed. Is there some better way to do this?

is there a way to write stub functions in zig?

Just like how Rust offers todo!() or how Ocaml has let func = "Failure "Unimplemented"" is there a way to write a function in zig that doesn’t have the body implemented and doesn’t raise any warnings and errors after being compiled?

Is it possible to override std_options when targeting WASM?

I’d like to declare my own std_options when targeting WASM so that I can provide a logging implementation that prints to the browser’s console window. I have a wasm_root.zig module that does just that, however, it’s not working. I suspect it’s because of how wasm binaries are compiled. In my case: