aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-01-23 04:43:46 +0100
committerPřemysl Eric Janouch <p@janouch.name>2022-01-23 04:44:41 +0100
commita7e638207f402bc69466c8820743128c78211241 (patch)
tree9f2d5ac61fda7c5d1372b97f1c2c5319a625e714
parent098895bfd92911b58a09bc3117a766d816bc2baf (diff)
downloadfiv-a7e638207f402bc69466c8820743128c78211241.tar.gz
fiv-a7e638207f402bc69466c8820743128c78211241.tar.xz
fiv-a7e638207f402bc69466c8820743128c78211241.zip
Fix Meson
The disabler, for some reason, bubbles up to its target.
-rw-r--r--meson.build39
1 files changed, 20 insertions, 19 deletions
diff --git a/meson.build b/meson.build
index af7a39b..6b92b6f 100644
--- a/meson.build
+++ b/meson.build
@@ -17,23 +17,8 @@ add_project_arguments(
#endif
# The likelihood of this being installed is nearly zero. Enable the wrap.
-libjpegqs = dependency('libjpegqs',
- required : get_option('libjpegqs'),
- allow_fallback : true,
-)
-
-# As of writing, the API is unstable, and no pkg-config file is produced.
-# Trying to wrap Cargo in Meson is a recipe for pain, so no version pinning.
-resvg = disabler()
-if not get_option('resvg').disabled()
- resvg = dependency('resvg', required : false)
- if not resvg.found()
- resvg = cc.find_library('libresvg', required : get_option('resvg'))
- if resvg.found() and not cc.has_header('resvg.h')
- error('resvg.h not found')
- endif
- endif
-endif
+libjpegqs = dependency('libjpegqs', required : get_option('libjpegqs'),
+ allow_fallback : true)
lcms2 = dependency('lcms2', required : get_option('lcms2'))
# Note that only libraw_r is thread-safe, but we'll just run it out-of process.
@@ -62,7 +47,6 @@ dependencies = [
lcms2,
libjpegqs,
libraw,
- resvg,
librsvg,
xcursor,
libheif,
@@ -72,13 +56,30 @@ dependencies = [
cc.find_library('m', required : false),
]
+# As of writing, the API is unstable, and no pkg-config file is produced.
+# Trying to wrap Cargo in Meson is a recipe for pain, so no version pinning.
+have_resvg = false
+if not get_option('resvg').disabled()
+ resvg = dependency('resvg', required : false)
+ if not resvg.found()
+ resvg = cc.find_library('libresvg', required : get_option('resvg'))
+ if resvg.found() and not cc.has_header('resvg.h')
+ error('resvg.h not found')
+ endif
+ endif
+ if resvg.found()
+ dependencies += resvg
+ have_resvg = true
+ endif
+endif
+
conf = configuration_data()
conf.set_quoted('PROJECT_NAME', meson.project_name())
conf.set_quoted('PROJECT_VERSION', meson.project_version())
conf.set('HAVE_JPEG_QS', libjpegqs.found())
conf.set('HAVE_LCMS2', lcms2.found())
conf.set('HAVE_LIBRAW', libraw.found())
-conf.set('HAVE_RESVG', resvg.found())
+conf.set('HAVE_RESVG', have_resvg)
conf.set('HAVE_LIBRSVG', librsvg.found())
conf.set('HAVE_XCURSOR', xcursor.found())
conf.set('HAVE_LIBHEIF', libheif.found())