]> gitweb.ps.run Git - chirp/blobdiff - build.zig
dunno
[chirp] / build.zig
index 7a13429b26b04e000cb321bdca628429b744ac39..f7d33f1ff32c99d370d09672b90a403c8fcdd268 100644 (file)
--- a/build.zig
+++ b/build.zig
@@ -14,6 +14,15 @@ pub fn build(b: *std.Build) void {
         .optimize = optimize,
     });
 
         .optimize = optimize,
     });
 
+    const epoll = b.addExecutable(.{
+        .name = "epoll",
+        // In this case the main source file is merely a path, however, in more
+        // complicated build scripts, this could be a generated file.
+        .root_source_file = .{ .cwd_relative = "src/epoll.zig" },
+        .target = target,
+        .optimize = optimize,
+    });
+
     const lmdb_mod = b.createModule(.{
         .root_source_file = .{ .cwd_relative = "../ziglmdb/src/lmdb.zig" },
     });
     const lmdb_mod = b.createModule(.{
         .root_source_file = .{ .cwd_relative = "../ziglmdb/src/lmdb.zig" },
     });
@@ -22,10 +31,13 @@ pub fn build(b: *std.Build) void {
         "./lmdb/libraries/liblmdb/midl.c",
         "./lmdb/libraries/liblmdb/mdb.c",
     } });
         "./lmdb/libraries/liblmdb/midl.c",
         "./lmdb/libraries/liblmdb/mdb.c",
     } });
-    exe.root_module.addImport("lmdb", lmdb_mod);
 
 
+    exe.root_module.addImport("lmdb", lmdb_mod);
     exe.linkLibC();
 
     exe.linkLibC();
 
+    epoll.root_module.addImport("lmdb", lmdb_mod);
+    epoll.linkLibC();
+
     b.installArtifact(exe);
 
     const run_cmd = b.addRunArtifact(exe);
     b.installArtifact(exe);
 
     const run_cmd = b.addRunArtifact(exe);
@@ -38,4 +50,8 @@ pub fn build(b: *std.Build) void {
 
     const run_step = b.step("run", "Run the app");
     run_step.dependOn(&run_cmd.step);
 
     const run_step = b.step("run", "Run the app");
     run_step.dependOn(&run_cmd.step);
+
+    const run_epoll_cmd = b.addRunArtifact(epoll);
+    const run_epoll_step = b.step("runepoll", "run epoll");
+    run_epoll_step.dependOn(&run_epoll_cmd.step);
 }
 }