aboutsummaryrefslogtreecommitdiffstats
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig33
1 files changed, 33 insertions, 0 deletions
diff --git a/build.zig b/build.zig
new file mode 100644
index 0000000..4456d5e
--- /dev/null
+++ b/build.zig
@@ -0,0 +1,33 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const exe = b.addExecutable(.{
+ .name = "ziglang-docs-epub",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/main.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ b.installArtifact(exe);
+
+ const run = b.addRunArtifact(exe);
+ run.step.dependOn(b.getInstallStep());
+ if (b.args) |args| run.addArgs(args);
+ const run_step = b.step("run", "Build EPUBs (optionally pass version filters)");
+ run_step.dependOn(&run.step);
+
+ const tests = b.addTest(.{
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/main.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ const run_tests = b.addRunArtifact(tests);
+ const test_step = b.step("test", "Run unit tests");
+ test_step.dependOn(&run_tests.step);
+}