From 2ce14aec655589f00442ab469b9d877a143eeefd Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 31 Jan 2025 07:36:52 +0100 Subject: init commit --- build.zig | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 build.zig (limited to 'build.zig') 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); +} -- cgit v1.2.3-70-g09d2