-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
48 lines (46 loc) · 1.65 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
const std = @import("std");
const zmpl_build = @import("zmpl");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const templates_paths = try zmpl_build.templatesPaths(
b.allocator,
&.{
.{ .prefix = "", .path = &.{
".",
} },
},
);
const exe = b.addExecutable(.{
.name = "play-zig",
.root_source_file = b.path("play.zig"),
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("s3db", b.dependency("s3db", .{
.target = target,
.optimize = optimize,
}).module("s3db"));
exe.root_module.addImport("tmpfile", b.dependency("tmpfile", .{}).module("tmpfile"));
exe.root_module.addImport("zcmd", b.dependency("zcmd", .{}).module("zcmd"));
exe.root_module.addImport("string", b.dependency("string", .{}).module("string"));
exe.root_module.addImport("ziglyph", b.dependency("ziglyph", .{}).module("ziglyph"));
exe.root_module.addImport("zmpl", b.dependency("zmpl", .{
.target = target,
.optimize = optimize,
.zmpl_templates_paths = templates_paths,
.sanitize = false,
}).module("zmpl"));
exe.root_module.addImport("httpz", b.dependency("httpz", .{
.target = target,
.optimize = optimize,
}).module("httpz"));
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
}