summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig39
1 files changed, 39 insertions, 0 deletions
diff --git a/build.zig b/build.zig
new file mode 100644
index 0000000..40cae2d
--- /dev/null
+++ b/build.zig
@@ -0,0 +1,39 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const pkg = b.dependency("eostre", .{
+ .target = target,
+ .optimize = optimize,
+ });
+
+ const exe = b.addExecutable(.{
+ .name = "shell",
+ .root_source_file = b.path("src/main.zig"),
+ .target = target,
+ .optimize = optimize
+ });
+
+ const run_exe = b.addRunArtifact(exe);
+ const run_step = b.step("run", "Run the application");
+ run_step.dependOn(&run_exe.step);
+
+ exe.root_module.addImport("eostre", pkg.module("eostre"));
+
+ const test_step = b.step("test", "Run unit tests");
+
+ const tests = b.addTest(.{
+ .name = "shell",
+ .root_source_file = b.path("src/main.zig"),
+ .target = target,
+ });
+ tests.root_module.addImport("eostre", pkg.module("eostre"));
+
+ const run_tests = b.addRunArtifact(tests);
+ test_step.dependOn(&run_tests.step);
+
+ const lib_tests = b.addRunArtifact(pkg.artifact("eostre"));
+ test_step.dependOn(&lib_tests.step);
+}