summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-11-30 16:32:21 +0530
committerEmmanuele Bassi <ebassi@gmail.com>2019-02-28 16:41:04 +0000
commitec4790359b0ac0afdf1bb2cd8064266e9e2ec170 (patch)
treefb2efc93fbc45ccdd952ba83f062f1b134b5349d /meson.build
parentbf6452b804601f8af5d7994c6be8847ac64e9d83 (diff)
downloadgdk-pixbuf-ec4790359b0ac0afdf1bb2cd8064266e9e2ec170.tar.gz
meson: Add subproject fallbacks for all dependencies
This is needed to build gtk+ and all dependencies from scratch on Windows with meson subprojects.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build33
1 files changed, 25 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index 3deff3302..6c5fa36cb 100644
--- a/meson.build
+++ b/meson.build
@@ -57,7 +57,14 @@ gdk_pixbuf_loaderdir = join_paths(gdk_pixbuf_libdir, 'gdk-pixbuf-@0@/@1@/loaders
# Dependencies
glib_req_version = '>= 2.38.0'
-gio_dep = dependency('gio-2.0', version: glib_req_version)
+glib_dep = dependency('glib-2.0', version: glib_req_version,
+ fallback : ['glib', 'libglib_dep'])
+gobject_dep = dependency('gobject-2.0', version: glib_req_version,
+ fallback : ['glib', 'libgobject_dep'])
+gmodule_dep = dependency('gmodule-no-export-2.0', version: glib_req_version,
+ fallback : ['glib', 'libgmodule_dep'])
+gio_dep = dependency('gio-2.0', version: glib_req_version,
+ fallback : ['glib', 'libgio_dep'])
# Configurations
gdk_pixbuf_conf = configuration_data()
@@ -184,11 +191,6 @@ if host_machine.system() == 'darwin'
gdk_pixbuf_conf.set('OS_DARWIN', 1)
endif
-# Dependencies
-gobject_dep = dependency('gobject-2.0', version: glib_req_version)
-gmodule_dep = dependency('gmodule-no-export-2.0')
-gio_dep = dependency('gio-2.0')
-
# On non-Windows/macOS systems we always required shared-mime-info and GIO
# shared_mime_dep = []
shared_mime_dep = []
@@ -211,10 +213,15 @@ if medialib_dep.found()
endif
endif
-gdk_pixbuf_deps = [ mathlib_dep, gobject_dep, gmodule_dep, gio_dep, shared_mime_dep, medialib_dep ]
+gdk_pixbuf_deps = [ mathlib_dep, glib_dep, gobject_dep, gmodule_dep, gio_dep,
+ shared_mime_dep, medialib_dep ]
# Check if we can build shared modules
-build_modules = gmodule_dep.get_pkgconfig_variable('gmodule_supported') == 'true'
+if gmodule_dep.type_name() == 'pkgconfig'
+ build_modules = gmodule_dep.get_pkgconfig_variable('gmodule_supported') == 'true'
+else
+ build_modules = subproject('glib').get_variable('g_module_impl') != '0'
+endif
gdk_pixbuf_conf.set('USE_GMODULE', build_modules)
# Check which loaders should be built into gdk-pixbuf
@@ -269,6 +276,16 @@ if get_option('png')
endif
endif
endif
+
+ # Finally, look for the dependency in a fallback subproject if allowed by
+ # the --wrap-mode option. We don't directly call subproject() here because
+ # that will bypass --wrap-mode and cause issues for distro packagers.
+ # See: https://mesonbuild.com/Reference-manual.html#dependency
+ png_dep = dependency('', required: false, fallback: ['libpng', 'png_dep'])
+ if png_dep.found()
+ enabled_loaders += 'png'
+ loaders_deps += png_dep
+ endif
endif
endif