Merge branch 'override-dependency' into 'master'

Meson: Override every dependency glib provides

See merge request GNOME/glib!1441
This commit is contained in:
Philip Withnall 2020-04-09 11:51:46 +00:00
commit bd45f71abb
5 changed files with 33 additions and 4 deletions

View File

@ -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)

View File

@ -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'

View File

@ -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

View File

@ -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])

View File

@ -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