diff --git a/gio/meson.build b/gio/meson.build index 2ef60eda9..39e246b9b 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -813,6 +813,10 @@ endif schemas_subdir = join_paths('glib-2.0', 'schemas') +libgio_dep = declare_dependency(link_with : libgio, + dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep], + include_directories : [gioinc]) + pkg.generate(libgio, libraries_private : [osx_ldflags], requires : ['glib-2.0', 'gobject-2.0'], @@ -835,6 +839,11 @@ pkg.generate(libgio, description : 'glib I/O library', ) +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('gio-2.0', libgio_dep) +endif + + if host_system == 'windows' pkg.generate(requires : ['gobject-2.0', 'gmodule-no-export-2.0', 'gio-2.0'], subdirs : ['gio-win32-2.0'], @@ -844,6 +853,9 @@ if host_system == 'windows' name : 'GIO Windows specific APIs', description : 'Windows specific headers for glib I/O library', ) + if meson.version().version_compare('>=0.54.0') + meson.override_dependency('gio-win32-2.0', libgio_dep) + endif else pkg.generate(requires : ['gobject-2.0', 'gio-2.0'], subdirs : ['gio-unix-2.0'], @@ -853,12 +865,11 @@ else name : 'GIO unix specific APIs', description : 'unix specific headers for glib I/O library', ) + if meson.version().version_compare('>=0.54.0') + meson.override_dependency('gio-unix-2.0', libgio_dep) + endif endif -libgio_dep = declare_dependency(link_with : libgio, - dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep], - include_directories : [gioinc]) - if host_system == 'windows' # Hack till https://github.com/mesonbuild/meson/issues/2324 is fixed libgiounix_dep = dependency('', required : false) diff --git a/glib/meson.build b/glib/meson.build index aaf5f00f5..3869f7a9d 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -385,6 +385,10 @@ pkg.generate(libglib, description : 'C Utility Library', ) +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('glib-2.0', libglib_dep) +endif + # On Windows, glib needs a spawn helper for g_spawn* API if host_system == 'windows' if host_machine.cpu_family() == 'x86' diff --git a/gmodule/meson.build b/gmodule/meson.build index 9801c9476..b1a5a11a9 100644 --- a/gmodule/meson.build +++ b/gmodule/meson.build @@ -120,3 +120,9 @@ pkg.generate(libraries : [libgmodule, export_dynamic_ldflags], libgmodule_dep = declare_dependency(link_with : libgmodule, include_directories : [gmoduleinc], dependencies : [libglib_dep]) + +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('gmodule-no-export-2.0', libgmodule_dep) + meson.override_dependency('gmodule-export-2.0', libgmodule_dep) + meson.override_dependency('gmodule-2.0', libgmodule_dep) +endif diff --git a/gobject/meson.build b/gobject/meson.build index 85e283bab..536f15393 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -143,6 +143,10 @@ libgobject_dep = declare_dependency(link_with : libgobject, include_directories : [gobjectinc], dependencies : [libglib_dep, glib_enumtypes_dep]) +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('gobject-2.0', libgobject_dep) +endif + executable('gobject-query', 'gobject-query.c', install : true, dependencies : [libglib_dep, libgobject_dep]) diff --git a/gthread/meson.build b/gthread/meson.build index d4fca40b8..808e889cc 100644 --- a/gthread/meson.build +++ b/gthread/meson.build @@ -34,3 +34,7 @@ pkg.generate(libgthread, ) libgthread_dep = declare_dependency(link_with : libgthread) + +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('gthread-2.0', libgthread_dep) +endif