[gobject-introspection/wip/meson] meson: Prefer source annotations for gir generation



commit 986ed8b54635ae2a0a5165a2af7cd8bdb97578cf
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Thu Dec 7 19:15:59 2017 +0530

    meson: Prefer source annotations for gir generation
    
    Otherwise we will see the fallback annotations provided in glib-2.0.c
    etc and use them instead of the up-to-date annotations in glib's
    source code.

 gir/meson.build |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/gir/meson.build b/gir/meson.build
index 8076633..e1d0119 100644
--- a/gir/meson.build
+++ b/gir/meson.build
@@ -67,7 +67,7 @@ for f in glob('@0@'):
 '''
 
 # GLib
-glib_files = files('glib-2.0.c')
+glib_files = []
 glib_command = scanner_command + [
   '--identifier-prefix=G',
   '--symbol-prefix=g',
@@ -154,6 +154,11 @@ foreach h : glib_headers
   endif
 endforeach
 
+# NOTE: Always add this last so that we prefer the annotations in the sources
+# (if they are available) since it contains 'backup' annotations that can be
+# out of date.
+glib_files += files('glib-2.0.c')
+
 glib_gir = custom_target('gir-glib',
   input: glib_files,
   output: 'GLib-2.0.gir',
@@ -174,7 +179,7 @@ glib_gir = custom_target('gir-glib',
 gir_files += glib_gir
 
 # GObject
-gobject_files = files('gobject-2.0.c')
+gobject_files = []
 gobject_command = scanner_command + [
   '--identifier-prefix=G',
   '--c-include=glib-object.h',
@@ -212,6 +217,11 @@ foreach h : gobject_headers
   endif
 endforeach
 
+# NOTE: Always add this last so that we prefer the annotations in the sources
+# (if they are available) since it contains 'backup' annotations that can be
+# out of date.
+gobject_files += files('gobject-2.0.c')
+
 gobject_gir = custom_target('gir-gobject',
   input: gobject_files,
   output: 'GObject-2.0.gir',
@@ -231,7 +241,7 @@ gobject_gir = custom_target('gir-gobject',
 gir_files += gobject_gir
 
 # GModule
-gmodule_files = files('gmodule-2.0.c')
+gmodule_files = []
 gmodule_command = scanner_command + [
   '--identifier-prefix=G',
   '--symbol-prefix=g',
@@ -254,6 +264,11 @@ else
                     join_paths(glibproj_incdir, 'gmodule', 'gmodule.c')]
 endif
 
+# NOTE: Always add this last so that we prefer the annotations in the sources
+# (if they are available) since it contains 'backup' annotations that can be
+# out of date.
+gmodule_files += files('gmodule-2.0.c')
+
 gir_files += custom_target('gir-gmodule',
   input: gmodule_files,
   output: 'GModule-2.0.gir',
@@ -270,7 +285,7 @@ gir_files += custom_target('gir-gmodule',
 )
 
 ## Gio
-gio_files = files('gio-2.0.c')
+gio_files = []
 gio_command = scanner_command + [
   '--identifier-prefix=G',
   '--symbol-prefix=g',
@@ -337,6 +352,11 @@ if giounix_dep.found()
   endforeach
 endif
 
+# NOTE: Always add this last so that we prefer the annotations in the sources
+# (if they are available) since it contains 'backup' annotations that can be
+# out of date.
+gio_files += files('gio-2.0.c')
+
 gir_files += custom_target('gir-gio',
   input: gio_files,
   output: 'Gio-2.0.gir',


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