summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig13
1 files changed, 11 insertions, 2 deletions
diff --git a/build.zig b/build.zig
index 3b57fff6..c70f52b2 100644
--- a/build.zig
+++ b/build.zig
@@ -421,11 +421,19 @@ pub fn build(b: *std.Build) void {
// One FreeType in a binary: the gui's glyph atlas links it and MuPDF is
// built against it (see mupdf.zig). At c_optimize with the rest of the
// vendored C, since MuPDF rasterizes a PDF's text through it.
- const freetype: ?*std.Build.Step.Compile = if (freestanding_core) null else b.dependency("freetype", .{
+ const freetype_dep: ?*std.Build.Dependency = if (freestanding_core) null else b.dependency("freetype", .{
.target = target,
.optimize = c_optimize,
.@"enable-libpng" = false,
- }).artifact("freetype");
+ });
+ const freetype: ?*std.Build.Step.Compile = if (freetype_dep) |dep| dep.artifact("freetype") else null;
+ // ...and one zlib, the one FreeType links for its gzip module. Asked of
+ // FreeType's build with the options it asks with, the dependency cache
+ // hands back that same artifact rather than a second copy.
+ const zlib: ?*std.Build.Step.Compile = if (freetype_dep) |dep|
+ dep.builder.dependency("zlib", .{ .target = target, .optimize = c_optimize }).artifact("z")
+ else
+ null;
if (enable_mupdf) {
if (b.lazyDependency("mupdf", .{})) |mupdf_dep| {
@@ -434,6 +442,7 @@ pub fn build(b: *std.Build) void {
.optimize = c_optimize,
.jpx = enable_jpx,
.freetype = freetype.?,
+ .zlib = zlib.?,
});
const mupdf_mod = b.createModule(.{
.target = target,