Skip to content

Commit

Permalink
Add zlib as a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
agagniere committed Sep 16, 2024
1 parent b08812c commit e647f94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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") },
Expand Down Expand Up @@ -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(.{
Expand Down Expand Up @@ -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(.{
Expand Down
4 changes: 4 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e647f94

Please sign in to comment.