mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 02:46:16 +01:00
10280deebd
Meson 0.54.0 added a new method meson.override_dependency() that must be used to ensure dependency consistency. This patch ensures a project that depends on glib will never link to a mix of system and subproject libraries. It would happen in such cases: The system has glib 2.40 installed, and a project does: dependency('glib-2.0', version: '>=2.60', fallback: ['glib', 'glib_dep']) dependency('gobject-2.0') The first call will configure glib subproject because the system libglib is too old, but the 2nd call will return system libgobject. By overriding 'gobject-2.0' dependency while configuring glib subproject during the first call, meson knows that on the 2nd call it must return the subproject dependency instead of system dependency. This also has the nice side effect that with Meson >0.54.0 an application depending on glib can declare the fallback without knowing the dependency variable name: dependency('glib-2.0', fallback: 'glib').
41 lines
1.1 KiB
Meson
41 lines
1.1 KiB
Meson
# Just a skeleton lib for backwards compatibility since all the functionaliy
|
|
# has been moved into glib now
|
|
|
|
gthread_sources = ['gthread-impl.c']
|
|
if host_system == 'windows'
|
|
gthread_win_rc = configure_file(
|
|
input: 'gthread.rc.in',
|
|
output: 'gthread.rc',
|
|
configuration: glibconfig_conf,
|
|
)
|
|
gthread_win_res = windows.compile_resources(gthread_win_rc)
|
|
gthread_sources += [gthread_win_res]
|
|
endif
|
|
|
|
libgthread = library('gthread-2.0',
|
|
sources : gthread_sources,
|
|
version : library_version,
|
|
soversion : soversion,
|
|
darwin_versions : darwin_versions,
|
|
install : true,
|
|
dependencies : [libglib_dep],
|
|
c_args : ['-DG_LOG_DOMAIN="GThread"' ] + glib_hidden_visibility_args,
|
|
link_args : glib_link_flags,
|
|
)
|
|
|
|
pkg.generate(libgthread,
|
|
libraries : [thread_dep],
|
|
requires : ['glib-2.0'],
|
|
version : glib_version,
|
|
install_dir : glib_pkgconfigreldir,
|
|
filebase : 'gthread-2.0',
|
|
name : 'GThread',
|
|
description : 'Thread support for GLib',
|
|
)
|
|
|
|
libgthread_dep = declare_dependency(link_with : libgthread)
|
|
|
|
if meson.version().version_compare('>=0.54.0')
|
|
meson.override_dependency('gthread-2.0', libgthread_dep)
|
|
endif
|