summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig28
1 files changed, 28 insertions, 0 deletions
diff --git a/build.zig b/build.zig
new file mode 100644
index 0000000..140a64f
--- /dev/null
+++ b/build.zig
@@ -0,0 +1,28 @@
1const std = @import("std");
2
3pub fn build(b: *std.build.Builder) void {
4 const target = b.standardTargetOptions(.{});
5 const mode = b.standardReleaseOptions();
6
7 const options_step = b.addOptions();
8 options_step.addOption(std.SemanticVersion, "es_version", .{
9 .major = 0,
10 .minor = 3,
11 .patch = 0,
12 });
13
14 const exe = b.addExecutable("es", "src/main.zig");
15 exe.setTarget(target);
16 exe.setBuildMode(mode);
17 exe.addOptions("es-config", options_step);
18 exe.install();
19
20 const run_cmd = exe.run();
21 run_cmd.step.dependOn(b.getInstallStep());
22 if (b.args) |args| {
23 run_cmd.addArgs(args);
24 }
25
26 const run_step = b.step("run", "Run the app");
27 run_step.dependOn(&run_cmd.step);
28}