gobject: Make GLib-2.0 gir build depend on GObject dependency

GLib gir requires glib-types.h that also includes gobject-visibility.h
that needs to be generated in order to be able to generate the GLib gir,
so explicitly add it to the sources.

Also, in order to link the typelib we need the definitions of the *_get_type()
functions that are defined in the gboxed.c file, so this should be part
of the gir sources or we'll have linking issues.
This commit is contained in:
Marco Trevisan (Treviño) 2023-12-20 02:17:01 +01:00
parent 30d6e911c4
commit 385ae1b964

View File

@ -163,6 +163,13 @@ pkg.generate(libgobject,
description : 'GLib Type, Object, Parameter and Signal Library',
)
libgobject_dep = declare_dependency(link_with : libgobject,
include_directories : [gobjectinc],
sources : [gobject_visibility_h, glib_enumtypes_h],
dependencies : [libglib_dep],
)
meson.override_dependency('gobject-2.0', libgobject_dep)
if enable_gir
# We generate GLib-2.0 here, as we need various GTypes
glib_gir = gnome.generate_gir(libglib,
@ -185,7 +192,7 @@ if enable_gir
export_packages: 'glib-2.0',
header: 'glib.h',
install: true,
dependencies: libglib_dep,
dependencies: libgobject_dep,
extra_args: gir_args + [
'-DGLIB_COMPILATION',
'-DGETTEXT_PACKAGE="dummy"',
@ -216,13 +223,6 @@ if enable_gir
)
endif
libgobject_dep = declare_dependency(link_with : libgobject,
include_directories : [gobjectinc],
sources : [gobject_visibility_h, glib_enumtypes_h],
dependencies : [libglib_dep],
)
meson.override_dependency('gobject-2.0', libgobject_dep)
gobject_query = executable('gobject-query', 'gobject-query.c',
install : true,
install_tag : 'bin-devel',