#Tell zig build-exe where to produce the executable (or where to copy)

1 messages · Page 1 of 1 (latest)

twin dagger
#

I want the exe generated by zig build-exe to be located in other location than the current working directory (for example zig build-exe main.c). What argument should I use? It needs to be CLI, not build.zig. To sum up, I want something like zig build-exe main.c -o main. I'd prefer to avoid passing arguments to clang if possible. Thanks

static dew
#

Are you trying to use zig a cc alternative? If so, just use zig cc with normal clang arguments.

twin dagger
#

For this case yeah, but as I said, I'd prefer to avoid clang arguments

tranquil plover
#

-femit-bin=path

twin dagger
# tranquil plover -femit-bin=path

I tried but ```zig build-exe -cflags -std=c2x -g -femit-bin=exe -- /home/david/dev/nativity/nat/shifts.c
PANIC:
Zig command exited with code 1:
:1:1: error: unknown argument: '-femit-bin=exe'

#

oh shit

#

nvm

#

my bad

#

I didn't terminate the cflags properly

tranquil plover
#

ye

#

I recommend using build.zig either way

#

but that works

twin dagger
#

yeah, thanks for the rubber duck 🙂