summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2026-10-11 03:39:42 -0500
committerNic Gaffney <gaffney_nic@protonmail.com>2026-10-11 03:39:42 -0500
commitffec10b0db469f9f940362439b7d17832d4a5268 (patch)
tree7110b022f309aa863531e0aa9d19b88e98d4f360 /build.zig
downloadnvlope-ffec10b0db469f9f940362439b7d17832d4a5268.tar.gz
simple asyncronous TCP server
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig46
1 files changed, 46 insertions, 0 deletions
diff --git a/build.zig b/build.zig
new file mode 100644
index 0000000..a87ac09
--- /dev/null
+++ b/build.zig
@@ -0,0 +1,46 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const mod = b.addModule("nvlope", .{
+ .root_source_file = b.path("src/lib/root.zig"),
+ .target = target,
+ });
+
+ const exe = b.addExecutable(.{
+ .name = "nvlope",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/bin/main.zig"),
+ .target = target,
+ .optimize = optimize,
+ .imports = &.{
+ .{ .name = "nvlope", .module = mod },
+ },
+ }),
+ });
+
+ b.installArtifact(exe);
+
+ const run_step = b.step("run", "Run the app");
+ const run_cmd = b.addRunArtifact(exe);
+ run_step.dependOn(&run_cmd.step);
+
+ run_cmd.step.dependOn(b.getInstallStep());
+ run_cmd.addPassthruArgs();
+
+ const mod_tests = b.addTest(.{
+ .root_module = mod,
+ });
+
+ const run_mod_tests = b.addRunArtifact(mod_tests);
+ const exe_tests = b.addTest(.{
+ .root_module = exe.root_module,
+ });
+
+ const run_exe_tests = b.addRunArtifact(exe_tests);
+ const test_step = b.step("test", "Run tests");
+ test_step.dependOn(&run_mod_tests.step);
+ test_step.dependOn(&run_exe_tests.step);
+}