diff --git a/build.zig b/build.zig index 5220610..235a2a8 100644 --- a/build.zig +++ b/build.zig @@ -5,6 +5,11 @@ pub fn build(b: *std.build.Builder) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); + // Modules available to downstream dependencies + _ = b.addModule("zlib", .{ + .source_file = .{ .path = (comptime thisDir()) ++ "/src/main.zig" }, + }); + const lib = zlib.create(b, target, optimize); b.installArtifact(lib.step); @@ -25,3 +30,8 @@ pub fn build(b: *std.build.Builder) void { lib.link(bin, .{ .import_name = "zlib" }); b.installArtifact(bin); } + +/// Path to the directory with the build.zig. +fn thisDir() []const u8 { + return std.fs.path.dirname(@src().file) orelse unreachable; +}