summaryrefslogtreecommitdiff
path: root/mupdf.zig
diff options
context:
space:
mode:
Diffstat (limited to 'mupdf.zig')
-rw-r--r--mupdf.zig13
1 files changed, 6 insertions, 7 deletions
diff --git a/mupdf.zig b/mupdf.zig
index cda9a38a..a157e850 100644
--- a/mupdf.zig
+++ b/mupdf.zig
@@ -41,6 +41,10 @@ pub fn add(b: *std.Build, io: std.Io, dependency: *std.Build.Dependency, options
/// ran the slim one. MuPDF asks nothing of FreeType the full
/// configuration lacks.
freetype: *std.Build.Step.Compile,
+ /// The zlib FreeType links, which MuPDF links instead of compiling the
+ /// one it bundles (ZLIB_SRC): the two define the same symbols, as the
+ /// FreeTypes do.
+ zlib: *std.Build.Step.Compile,
}) Result {
const module = b.createModule(.{
.target = options.target,
@@ -53,8 +57,9 @@ pub fn add(b: *std.Build, io: std.Io, dependency: *std.Build.Dependency, options
// debug-locking/assertion paths. linkTo applies the same public-header
// contract to consumers; keeping it here also covers every archive source.
module.addCMacro("NDEBUG", "1");
- // The build's own FreeType, headers and all; see `freetype` above.
+ // The build's own FreeType and zlib, headers and all; see above.
module.linkLibrary(options.freetype);
+ module.linkLibrary(options.zlib);
// MuPDF itself uses wildcards for these two directories. The dependency
// is immutable and content-addressed, so discovering the flat C lists at
@@ -97,11 +102,6 @@ pub fn add(b: *std.Build, io: std.Io, dependency: *std.Build.Dependency, options
});
module.addCSourceFiles(.{
.root = dependency.path(""),
- .files = makeSources(b, makelists, "ZLIB_SRC"),
- .flags = &.{ "-std=gnu11", "-DHAVE_UNISTD_H", "-DHAVE_STDARG_H" },
- });
- module.addCSourceFiles(.{
- .root = dependency.path(""),
.files = makeSources(b, makelists, "JBIG2DEC_SRC"),
.flags = &.{
"-std=gnu11",
@@ -252,7 +252,6 @@ fn configureModule(module: *std.Build.Module, dependency: *std.Build.Dependency,
module.addIncludePath(dependency.path("source/pdf"));
module.addIncludePath(dependency.path("thirdparty/libjpeg"));
module.addIncludePath(dependency.path("scripts/libjpeg"));
- module.addIncludePath(dependency.path("thirdparty/zlib"));
module.addIncludePath(dependency.path("thirdparty/jbig2dec"));
// encode-jpx.c includes this header before its FZ_ENABLE_JPX guard.
module.addIncludePath(dependency.path("thirdparty/openjpeg/src/lib/openjp2"));