From e647f948f2dd149e7779b813166df4ffac80e1d4 Mon Sep 17 00:00:00 2001 From: Antoine Date: Mon, 16 Sep 2024 14:08:13 +0200 Subject: [PATCH] Add zlib as a dependency --- build.zig | 4 ++++ build.zig.zon | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/build.zig b/build.zig index 637de9d..e712e6d 100644 --- a/build.zig +++ b/build.zig @@ -9,7 +9,9 @@ pub fn build(b: *std.Build) !void { const upstream = b.dependency("upstream", .{ .target = target, .optimize = optimize }); const openssl = b.dependency("openssl", .{ .target = target, .optimize = optimize }); + const zlib_dep = b.dependency("zlib", .{ .target = target, .optimize = optimize }); const openssllib = openssl.artifact("openssl"); + const zlib = zlib_dep.artifact("z"); const config_ext = b.addConfigHeader(.{ .style = .{ .autoconf = upstream.path("src/include/pg_config_ext.h.in") }, @@ -87,6 +89,7 @@ pub fn build(b: *std.Build) !void { lib.installConfigHeader(config_ext); lib.installConfigHeader(config_os); lib.linkLibrary(openssllib); + lib.linkLibrary(zlib); b.installArtifact(lib); const portlib = b.addStaticLibrary(.{ @@ -199,6 +202,7 @@ pub fn build(b: *std.Build) !void { .flags = &CFLAGS, }); common.linkLibrary(openssllib); + common.linkLibrary(zlib); b.installArtifact(common); const test1 = b.addExecutable(.{ diff --git a/build.zig.zon b/build.zig.zon index 83e4de0..3360176 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -10,6 +10,10 @@ .url = "git+https://github.com/allyourcodebase/openssl?ref=3.3.0#37f44e18975205c8111fec16b896c2f937667465", .hash = "12200078346510dd1010ac11cf1d46b0e51cda1b3c80f3b2fb375194f52f70cbf0a0", }, + .zlib = .{ + .url = "git+https://github.com/allyourcodebase/zlib?ref=1.3.1#0918e87b7629b9c6a50a08edd0ce30d849758faf", + .hash = "122034ab2a12adf8016ffa76e48b4be3245ffd305193edba4d83058adbcfa749c107", + }, }, .paths = .{ "build.zig",