[gtk: 1/3] meson: Fix generate_gir() dependencies




commit b18e95d6b369eaed490722691f5a4255a8394f2c
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Fri Jun 25 10:07:55 2021 -0400

    meson: Fix generate_gir() dependencies
    
    There is no need to search for gir variables into subprojects, they are
    part of dependencies objects, meson will find them there.

 gtk/meson.build | 38 +++++++-------------------------------
 1 file changed, 7 insertions(+), 31 deletions(-)
---
diff --git a/gtk/meson.build b/gtk/meson.build
index 416be43bdc..7f892ffee8 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -1156,23 +1156,7 @@ if build_gir
     '--warn-error',
   ]
 
-  # We may build some of the dependencies as sub-projects; this means
-  # that we need to depend on the built introspection data, instead of
-  # the installed one
-  gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', ]
-
-  if pixbuf_dep.type_name() == 'internal'
-    gdk_gir_inc += subproject('gdk-pixbuf').get_variable('gdkpixbuf_gir').get(0)
-  else
-    gdk_gir_inc += 'GdkPixbuf-2.0'
-  endif
-
-  if pango_dep.type_name() == 'internal'
-    gdk_gir_inc += subproject('pango').get_variable('pango_gir').get(0)
-    gdk_gir_inc += subproject('pango').get_variable('pangocairo_gir').get(0)
-  else
-    gdk_gir_inc += ['Pango-1.0', 'PangoCairo-1.0']
-  endif
+  gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', 'GdkPixbuf-2.0', 'Pango-1.0', 'PangoCairo-1.0' ]
 
   gdk_gir = gnome.generate_gir(libgtk,
     sources: gdk_public_headers + gdk_public_sources + [ gdkenum_h ],
@@ -1184,9 +1168,9 @@ if build_gir
     includes: gdk_gir_inc,
     header: 'gdk/gdk.h',
     install: true,
+    dependencies: libgdk_dep,
     extra_args: gir_args,
   )
-  gdk_gir_dep = declare_dependency(sources: gdk_gir)
   gtk_dep_sources += gdk_gir
 
   if x11_enabled
@@ -1199,7 +1183,7 @@ if build_gir
       export_packages: 'gtk4-x11',
       includes: [ gdk_gir[0], 'xlib-2.0', ],
       install: true,
-      dependencies: gdk_gir_dep,
+      dependencies: libgdk_dep,
       header: 'gdk/x11/gdkx.h',
       extra_args: gir_args,
     )
@@ -1216,20 +1200,14 @@ if build_gir
       export_packages: 'gtk4-wayland',
       includes: [ gdk_gir[0], ],
       install: true,
-      dependencies: gdk_gir_dep,
+      dependencies: libgdk_dep,
       header: 'gdk/wayland/gdkwayland.h',
       extra_args: gir_args,
     )
     gtk_dep_sources += gdk_wayland_gir
   endif
 
-  gsk_gir_inc = [ gdk_gir[0] ]
-
-  if graphene_dep.type_name() == 'internal'
-    gsk_gir_inc += subproject('graphene').get_variable('graphene_gir').get(0)
-  else
-    gsk_gir_inc += 'Graphene-1.0'
-  endif
+  gsk_gir_inc = [ gdk_gir[0], 'Graphene-1.0' ]
 
   gsk_gir = gnome.generate_gir(libgtk,
     sources: gsk_public_headers + gsk_public_sources + [ gskenum_h ],
@@ -1241,11 +1219,9 @@ if build_gir
     includes: gsk_gir_inc,
     header: 'gsk/gsk.h',
     install: true,
-    dependencies: [gdk_gir_dep, graphene_dep],
+    dependencies: libgsk_dep,
     extra_args: gir_args,
   )
-  gsk_gir_dep = declare_dependency(dependencies: [gdk_gir_dep, graphene_dep],
-                                   sources: gsk_gir)
   gtk_dep_sources += gsk_gir
 
   gtk_introspection_sources = [
@@ -1277,7 +1253,7 @@ if build_gir
     includes: [ gdk_gir[0], gsk_gir[0], ],
     header: 'gtk/gtk.h',
     install: true,
-    dependencies: gsk_gir_dep,
+    dependencies: [gtk_deps, libgsk_dep],
     extra_args: gir_args,
   )
   gtk_dep_sources += gtk_gir


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]