-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
51 lines (43 loc) · 1.45 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
49
50
51
const std = @import("std");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const inon_mod = b.addModule("inon", .{
.source_file = .{ .path = "src/main.zig" },
.dependencies = &.{
.{
.name = "parser-toolkit",
.module = b.dependency("parser-toolkit", .{
.optimize = optimize,
}).module("parser-toolkit"),
},
},
});
// Demo application
const demo = b.addExecutable(.{
.name = "inon-demo",
.root_source_file = .{ .path = "demo.zig" },
.optimize = optimize,
});
demo.addModule("inon", inon_mod);
b.installArtifact(demo);
const run_step = b.step("run-demo", "Run the demo");
run_step.dependOn(&b.addRunArtifact(demo).step);
// Repl application
const repl = b.addExecutable(.{
.name = "inon-repl",
.root_source_file = .{ .path = "repl.zig" },
.optimize = optimize,
});
repl.addModule("inon", inon_mod);
b.installArtifact(repl);
const repl_step = b.step("run-repl", "Run the repl");
repl_step.dependOn(&b.addRunArtifact(repl).step);
// Tests
const tests = b.addTest(.{
.root_source_file = .{ .path = "src/test.zig" },
.optimize = optimize,
});
tests.addModule("inon", inon_mod);
const tests_step = b.step("test", "Run tests");
tests_step.dependOn(&b.addRunArtifact(tests).step);
}