Open alexjgriffith opened 1 year ago
zig build
automatically searches for a build.zig
file in the current directory or in all parent directories.
joachim@pier ~ % ~/src/zig/build/stage3/bin/zig build
info: Initialize a 'build.zig' template file with `zig init-lib` or `zig init-exe`,
or see `zig --help` for more options.
error: No 'build.zig' file found, in the current directory or any parent directories.
joachim@pier ~ %
In my opinion, we shouldn't support other build file names than build.zig
as this is also the default enforced by the zig compiler.
I agree with @joachimschmidt557, this addition seems unnecessary.
For interactive projects its nice to do a quick build run from any file your working on.
The new
zig-project-build-run
interactive function identifies the root of the project and calls the appropriate executable with the argumentsbuild run
.By default it is bound to
C-c C-p
.This PR adds two additional customs
zig-project-build-file
is the name of the file you wish to use as your build file. It defaults tobuild.zig
zig-project-root-search-up
is the number of directories you wish to search up for thezig-project-build-file
. This is used to ensure the function terminates.If the project root cannot be found,
zig-project-build-run
indicates so in Messages.