summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-01-31 07:36:52 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2025-01-31 07:36:52 +0100
commit2ce14aec655589f00442ab469b9d877a143eeefd (patch)
tree8cd12b1869d10ef16a449a8e182a3077b86c9810 /build.zig
init commit
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);
+}