[glib: 1/2] meson: Add schemasdir and giomoduledir to gio dependency




commit 5aa03882cac8878d92aea26124d2a1ee8bc7e543
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Mon Feb 21 13:03:15 2022 -0500

    meson: Add schemasdir and giomoduledir to gio dependency
    
    This allows applications to get their value regardless whether glib is a
    subproject or pkgconfig:
    
      gio_dep = dependency('gio-2.0')
      giomoduledir = gio_dep.get_variable('giomoduledir')
      schemasdir = gio_dep.get_variable('schemasdir')

 gio/meson.build | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/gio/meson.build b/gio/meson.build
index 139a48c86..22964ea3f 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -819,9 +819,22 @@ endif
 
 schemas_subdir = join_paths('glib-2.0', 'schemas')
 
+# Work around variables kwarg requiring Meson 0.56
+declare_dependency_kwargs = {}
+if meson.version().version_compare('>=0.56.0')
+  declare_dependency_kwargs = {
+    'variables': [
+      'schemasdir=' + join_paths(glib_datadir, schemas_subdir),
+      'giomoduledir=' + glib_giomodulesdir,
+    ]
+  }
+endif
+
 libgio_dep = declare_dependency(link_with : libgio,
   dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep],
-  include_directories : [gioinc])
+  include_directories : [gioinc],
+  kwargs : declare_dependency_kwargs,
+)
 
 pkg.generate(libgio,
   requires : ['glib-2.0', 'gobject-2.0'],


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]