-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
37 lines (31 loc) · 1019 Bytes
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const root_source_file = b.path("src/main.zig");
const version = std.SemanticVersion{ .major = 1, .minor = 1, .patch = 0 };
// Executable
const exe_step = b.step("exe", "Run executable");
const exe = b.addExecutable(.{
.name = "githunt",
.target = target,
.version = version,
.optimize = optimize,
.root_source_file = root_source_file,
});
b.installArtifact(exe);
const exe_run = b.addRunArtifact(exe);
exe_step.dependOn(&exe_run.step);
b.default_step.dependOn(exe_step);
// Formatting checks
const fmt_step = b.step("fmt", "Run formatting checks");
const fmt = b.addFmt(.{
.paths = &.{
"src/",
"build.zig",
},
.check = true,
});
fmt_step.dependOn(&fmt.step);
b.default_step.dependOn(fmt_step);
}