build: make svg buttons optional

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
This commit is contained in:
Johan Malm 2023-09-17 11:40:48 +01:00 committed by Johan Malm
parent c598cf7f11
commit 715405fe29
3 changed files with 9 additions and 3 deletions

View 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,
]