Search code examples
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?


Solution

  • -femit-bin=path/to/output_file

    Similar options are available for emitting other things