From 0797d89ad75f4a843291aaa2c6d2ad5c7a156a81 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 18 Dec 2022 09:11:15 +0530 Subject: meson: Override dependencies to improve usage as a subproject With this change, gdk-pixbuf can be consumed as a subproject without making any changes to the build files of a project. All you need to do is provide a wrap file with a `[provide]` section: https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section This is also necessary because otherwise projects need to hard-code the subproject name, which might be `gdk-pixbuf` when using `wrap-git` or `gdk-pixbuf-2.42.10` when using `wrap-file` (to build from a release tarball). This can cause conflicts between different subprojects that consume gdk-pixbuf differently. Other projects like glib, cairo, pango, etc already do this. --- gdk-pixbuf/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build index 54ff9dda3..a11926eee 100644 --- a/gdk-pixbuf/meson.build +++ b/gdk-pixbuf/meson.build @@ -272,6 +272,7 @@ gdkpixbuf_dep = declare_dependency( dependencies: gdk_pixbuf_deps, sources: [ gdkpixbuf_enum_h, built_girs ], ) +meson.override_dependency('gdk-pixbuf-2.0', gdkpixbuf_dep) # Now check if we are building loaders as installed shared modules # We do this here because shared modules depend on libgdk-pixbuf -- cgit v1.2.1