From 97568ff864876098579f5510624ae92995404d75 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 8 Nov 2026 20:58:56 -0300 Subject: fix: a build with the addons compiled in (any off Linux, the static step) and -Dpdf=false did not compile, Addon.zig importing a pdf_addon the build had not made: the builtin_addons options say whether the pdf addon is built, and without it the image addon is compiled in alone; an aarch64-macos -Dpdf=false compile no longer names pdf_addon (its one error left is daemon.zig's darwin CMSG_CLOEXEC, a break of its own) Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Addon.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Addon.zig') diff --git a/src/Addon.zig b/src/Addon.zig index 67939f57..fa41f774 100644 --- a/src/Addon.zig +++ b/src/Addon.zig @@ -179,7 +179,13 @@ var nfound: usize = 0; /// the image and pdf modules' `pardes_addon` declarations, which only a /// library exports. A static binary cannot dlopen, and the loader below /// is Linux's (a memfd): this is how either has image and PDF panes. -const compiled_in: []const *const Kind.Ops = if (@import("builtin_addons").on) &.{ &@import("image_addon").pardes_addon, &@import("pdf_addon").pardes_addon } else &.{}; +/// A build with -Dpdf=false has the image addon alone. +const compiled_in: []const *const Kind.Ops = if (!@import("builtin_addons").on) + &.{} +else if (@import("builtin_addons").pdf) + &.{ &@import("image_addon").pardes_addon, &@import("pdf_addon").pardes_addon } +else + &.{&@import("image_addon").pardes_addon}; /// The addons compiled in, as if loaded (`builtin` their path); else every /// library of the two directories, in name order each, the user's first. A -- cgit v1.3