On building an application using zig build, the output binary is produced in the ./zig-out/bin/ directory.
My build.zig is:
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const executable = b.addExecutable(.{
.name = "cow",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
}),
});
b.installArtifact(executable);
const executable_step = b.step("run", "Run the app");
executable_step.dependOn(&executable.step);
const install_executable = b.addRunArtifact(executable);
install_executable.step.dependOn(b.getInstallStep());
}
I would like to update build.zig so that the binary is produced in the project root - as the project’s config file is also at the project root.
Appreciate any help !