From 24cbd2fc5c2f8246763672e75de2ca5c03d08b71 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sun, 29 Sep 2024 15:09:05 +0100 Subject: [PATCH] [fixup] make xpm optional at build time (default disabled) --- meson.build | 6 ++++++ meson_options.txt | 1 + src/icon-loader.c | 5 +++++ src/img/meson.build | 7 ++++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e5ccae58..a9264153 100644 --- a/meson.build +++ b/meson.build @@ -106,6 +106,12 @@ else endif conf_data.set10('HAVE_RSVG', have_rsvg) +have_xpm = false +if get_option('xpm').enabled() + have_xpm = true +endif +conf_data.set10('HAVE_XPM', have_xpm) + have_libsfdo = sfdo_basedir.found() and sfdo_desktop.found() and sfdo_icon.found() conf_data.set10('HAVE_LIBSFDO', have_libsfdo) diff --git a/meson_options.txt b/meson_options.txt index ec3fe85d..eebd2536 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,7 @@ option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications') option('svg', type: 'feature', value: 'enabled', description: 'Enable svg window buttons') +option('xpm', type: 'feature', value: 'disabled', description: 'Enable xpm window buttons') option('icon', type: 'feature', value: 'enabled', description: 'Enable window icons') option('nls', type: 'feature', value: 'auto', description: 'Enable native language support') option('static_analyzer', type: 'feature', value: 'disabled', description: 'Run gcc static analyzer') diff --git a/src/icon-loader.c b/src/icon-loader.c index 96afaa27..99bdf981 100644 --- a/src/icon-loader.c +++ b/src/icon-loader.c @@ -8,7 +8,10 @@ #include "config.h" #include "icon-loader.h" #include "img/img-png.h" + +#if HAVE_XPM #include "img/img-xpm.h" +#endif #if HAVE_RSVG #include "img/img-svg.h" @@ -180,7 +183,9 @@ icon_loader_lookup(struct server *server, const char *app_id, int size, int scal #endif break; case SFDO_ICON_FILE_FORMAT_XPM: +#if HAVE_XPM img_xpm_load(ctx.path, &icon_buffer); +#endif break; } diff --git a/src/img/meson.build b/src/img/meson.build index 6db8035e..32627aff 100644 --- a/src/img/meson.build +++ b/src/img/meson.build @@ -1,9 +1,14 @@ labwc_sources += files( 'img-png.c', 'img-xbm.c', - 'img-xpm.c', ) +if have_xpm + labwc_sources += files( + 'img-xpm.c', + ) +endif + if have_rsvg labwc_sources += files( 'img-svg.c',