X-Git-Url: https://gitweb.ps.run/chirp/blobdiff_plain/c1543f56be31c2d071db75dd7f146e1b5e0de4fe..8ce4f0b76cab1963cd0a8ad55bf5b30b9eae917f:/build.zig?ds=sidebyside diff --git a/build.zig b/build.zig index 7a13429..f7d33f1 100644 --- a/build.zig +++ b/build.zig @@ -14,6 +14,15 @@ pub fn build(b: *std.Build) void { .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" }, }); @@ -22,10 +31,13 @@ pub fn build(b: *std.Build) void { "./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(); + epoll.root_module.addImport("lmdb", lmdb_mod); + epoll.linkLibC(); + 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_epoll_cmd = b.addRunArtifact(epoll); + const run_epoll_step = b.step("runepoll", "run epoll"); + run_epoll_step.dependOn(&run_epoll_cmd.step); }