gmodule: Define a gmodule include dependency and use it in gio modules

Various gio modules include gmodule.h that requires the
gmodule-visibility.h to be already built.

To make this easier, just provide a dependency and use it where we are
building modules that do not depend on libgio_dep (that already includes
that).

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2982


(cherry picked from commit fe38a02c62)
This commit is contained in:
Marco Trevisan (Treviño) 2023-04-19 21:06:34 +02:00 committed by Marco Trevisan
parent e82348db62
commit 4ed5539d0a
4 changed files with 26 additions and 11 deletions

View File

@ -8,9 +8,14 @@ inotify_sources = [
]
inotify_lib = static_library('inotify',
sources : [inotify_sources, gmodule_visibility_h],
include_directories : [configinc, glibinc, gmoduleinc],
dependencies : [gioenumtypes_dep, libglib_dep, libgobject_dep],
sources : [inotify_sources],
include_directories : [configinc, glibinc],
dependencies : [
gioenumtypes_dep,
libglib_dep,
libgobject_dep,
gmodule_inc_dep,
],
gnu_symbol_visibility : 'hidden',
pic : true,
c_args : [gio_c_args, gio_c_args_internal])

View File

@ -6,9 +6,12 @@ kqueue_sources = [
]
kqueue_lib = static_library('kqueue',
sources : kqueue_sources,
include_directories : [configinc, glibinc, gmoduleinc],
dependencies : [gioenumtypes_dep],
sources : [kqueue_sources],
include_directories : [configinc, glibinc],
dependencies : [
gioenumtypes_dep,
gmodule_inc_dep,
],
gnu_symbol_visibility : 'hidden',
pic : true,
c_args : [gio_c_args, gio_c_args_internal])

View File

@ -9,8 +9,12 @@ giowin32_sources = [
giowin32_lib = static_library('giowin32',
sources : [giowin32_sources],
include_directories : [configinc, glibinc, gioinc, gmoduleinc],
dependencies : [libintl, gioenumtypes_dep],
include_directories : [configinc, glibinc, gioinc],
dependencies : [
libintl,
gioenumtypes_dep,
gmodule_inc_dep,
],
gnu_symbol_visibility : 'hidden',
pic : true,
c_args : [gio_c_args, gio_c_args_internal])

View File

@ -135,10 +135,13 @@ pkg.generate(libraries : [libgmodule, export_dynamic_ldflags],
description : 'Dynamic module loader for GLib',
)
gmodule_inc_dep = declare_dependency(
include_directories: [gmoduleinc],
sources: [gmodule_visibility_h],
)
libgmodule_dep = declare_dependency(link_with : libgmodule,
include_directories : [gmoduleinc],
sources : [gmodule_visibility_h],
dependencies : [libglib_dep])
dependencies : [libglib_dep, gmodule_inc_dep])
meson.override_dependency('gmodule-no-export-2.0', libgmodule_dep)
meson.override_dependency('gmodule-export-2.0', libgmodule_dep)