]> git.mdlowis.com Git - proto/labwc.git/commitdiff
build: make svg buttons optional
authorJohan Malm <jgm323@gmail.com>
Sun, 17 Sep 2023 10:40:48 +0000 (11:40 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 17 Sep 2023 18:26:41 +0000 (19:26 +0100)
Add -Dsvg=disabled to your meson setup/configure command to disable svg
buttons even if the correct version of librsvg is available.

Note that regardless of this patch and the value of the 'svg' variable,
the build will gracefully fall back to not using librsvg if the correct
version is not available.

Helped-by: @01micko
meson.build
meson_options.txt
src/button/meson.build

index 53cfc5d04e3ec18009afa61d06df50062be70cef..5b616cac54b7b2a6727684382cbf2779af5837d4 100644 (file)
@@ -79,7 +79,12 @@ have_xwayland = xcb.found() and wlroots_has_xwayland
 conf_data = configuration_data()
 conf_data.set10('HAVE_XWAYLAND', have_xwayland)
 
-conf_data.set10('HAVE_RSVG', svg.found())
+if get_option('svg').disabled()
+  have_rsvg = false
+else
+  have_rsvg = svg.found()
+endif
+conf_data.set10('HAVE_RSVG', have_rsvg)
 
 msgfmt = find_program('msgfmt', required: get_option('nls'))
 if msgfmt.found()
@@ -109,7 +114,7 @@ labwc_deps = [
   math,
   png,
 ]
-if svg.found()
+if have_rsvg
   labwc_deps += [
     svg,
   ]
index 00558f17ef628daa11a44d079de97c6bc7f5289d..9104ec9ad4c1ede61975877ed5ee2d9e6a1fc59b 100644 (file)
@@ -1,3 +1,4 @@
 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('nls', type: 'feature', value: 'auto', description: 'Enable native language support')
index f0f24e96d26c3868f98c38d183422b020e5e0e49..2e587eafc5ae67fe4b3d23fe1aafea6524363815 100644 (file)
@@ -4,7 +4,7 @@ labwc_sources += files(
   'common.c',
 )
 
-if svg.found()
+if have_rsvg
   labwc_sources += files(
     'button-svg.c',
   )