From 484fbca06312dbe0f381109763f701671f22e602 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 13 Jul 2026 21:13:35 +0300 Subject: modernfmt: JXL/HEIF/AVIF loader backends, conditional (qt0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- meson.build | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'meson.build') 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, ) -- cgit v1.2.3