mirror of
https://github.com/ziglang/zig.git
synced 2026-01-04 12:33:19 +00:00
init-lib creates a working static library with tests, and init-exe creates a working hello world with a `run` target. both now have test coverage with the new "cli tests" file. closes #1035
16 lines
491 B
Zig
16 lines
491 B
Zig
const Builder = @import("std").build.Builder;
|
|
|
|
pub fn build(b: *Builder) void {
|
|
const mode = b.standardReleaseOptions();
|
|
const exe = b.addExecutable("$", "src/main.zig");
|
|
exe.setBuildMode(mode);
|
|
|
|
const run_step = b.step("run", "Run the app");
|
|
const run_cmd = b.addCommand(".", b.env_map, [][]const u8{exe.getOutputPath()});
|
|
run_step.dependOn(&run_cmd.step);
|
|
run_cmd.step.dependOn(&exe.step);
|
|
|
|
b.default_step.dependOn(&exe.step);
|
|
b.installArtifact(exe);
|
|
}
|