summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-13 21:13:35 +0300
committerPaul Buetow <paul@buetow.org>2026-07-13 21:13:35 +0300
commit484fbca06312dbe0f381109763f701671f22e602 (patch)
treeee8bc47f32a2a767831e05a5b949c5a05aeec4f5 /meson.build
parent25ee19ce91dcb204d93e6d8cceb7cd64d5f057f9 (diff)
modernfmt: JXL/HEIF/AVIF loader backends, conditional (qt0)
M5 (task qt0): modern format backends. - src/loader/backends/jxl.c: libjxl decoder → RGBA → GdkMemoryTexture. - src/loader/backends/heif.c: libheif decoder → interleaved RGBA → GdkMemoryTexture (also handles AVIF when libavif is absent). - src/loader/backends/avif.c: libavif decoder (written; auto-disabled when libavif is not installed). - src/loader/loader.c: BACKENDS array conditionally includes the backends via -DHAVE_JXL/HAVE_AVIF/HAVE_HEIF; pixbuf remains last (fallback). - meson.build: conditional backend sources + c_args + extra deps. - tests: assert_unsupports updated to assert NULL only (any error, works with or without the specific backend compiled in). - Minimal build (all disabled) + full build (jxl+heif) both 14/14 green, ASan clean.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build30
1 files changed, 26 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 7f9c3f2..4611532 100644
--- a/meson.build
+++ b/meson.build
@@ -53,8 +53,7 @@ src_inc = include_directories('src')
# tests so the GApplication/GtkApplicationWindow code is exercised without
# duplicating sources). Plain-C modules will join this library as they
# land (navigator, trash, mover, ...).
-ggaze_lib = static_library('ggaze',
- files(
+ggaze_src = files(
'src/app.c',
'src/window.c',
'src/viewer.c',
@@ -68,9 +67,32 @@ ggaze_lib = static_library('ggaze',
'src/loader/loader.c',
'src/loader/detect.c',
'src/loader/backends/pixbuf.c',
- ),
+ )
+ggaze_c_args = []
+ggaze_extra_deps = []
+
+if jxl_dep.found()
+ ggaze_src += files('src/loader/backends/jxl.c')
+ ggaze_c_args += '-DHAVE_JXL'
+ ggaze_extra_deps += jxl_dep
+endif
+if avif_dep.found()
+ ggaze_src += files('src/loader/backends/avif.c')
+ ggaze_c_args += '-DHAVE_AVIF'
+ ggaze_extra_deps += avif_dep
+endif
+if heif_dep.found()
+ ggaze_src += files('src/loader/backends/heif.c')
+ ggaze_c_args += '-DHAVE_HEIF'
+ ggaze_extra_deps += heif_dep
+endif
+
+ggaze_lib = static_library('ggaze',
+ ggaze_src,
include_directories : [inc, src_inc],
- dependencies : [gtk4_dep, glib_dep, gio_dep, adwaita_dep, gdkpixbuf_dep, libexif_dep],
+ dependencies : [gtk4_dep, glib_dep, gio_dep, adwaita_dep, gdkpixbuf_dep,
+ libexif_dep] + ggaze_extra_deps,
+ c_args : ggaze_c_args,
install : false,
)