Basic Executable
The simplest possible buildx.zig project.
build.zig
zig
const std = @import("std");
const buildx = @import("buildx");
pub fn build(b: *std.Build) void {
_ = buildx.project(b, .{
.name = "hello",
.root = "src/main.zig",
.install = true,
});
}src/main.zig
zig
const std = @import("std");
pub fn main() void {
std.debug.print("Hello from buildx.zig!\n", .{});
}Build & Run
bash
zig build
zig-out/bin/helloOutput:
Hello from buildx.zig!What Happens
install = truecreates an install stepzig buildcompiles and installs tozig-out/bin/hello- No run step - you execute the binary directly