#zig build introspection

1 messages · Page 1 of 1 (latest)

green urchin
#

Is there a way to get the path into which zig build is going to / has installed the output executable? Or at least the project name so that I can build the default one myself? I need that for some generic debugger config -- it needs to know which executable to run on.

bleak pumice
still sparrow
#

you'll have something like const exe = b.addExecutable(...) and then you can get the output path with exe.getEmittedBin()

#

in general executables are emitted by default into the zig-out/bin directory

safe fox
#

It's not super clear what you're asking about.
A well-behaved build.zig script will always install files in the path specified by the --prefix option (defaults to zig-out/), never outside of this directory. Different kinds of artifacts have different default subdirectories of the install prefix they will be placed in (bin/, lib/, include/, etc.) but the build script is free to override them.

tough oasis
green urchin
#

But I think I have an idea of how to do that

#

I'm just going to scan the output directory and make the user select an executable

still sparrow