[babl/wip/nielsdg/gir] Add GObject Introspection support to babl



commit 40dfcc8ee340b8c25536856a30103629480aaf6d
Author: Niels De Graef <niels degraef barco com>
Date:   Mon Aug 5 18:03:23 2019 +0200

    Add GObject Introspection support to babl
    
    This is needed for GIMP to also have proper GIR support for its plugins.

 babl/babl-types.h |  4 +---
 babl/meson.build  | 13 +++++++++++++
 meson_options.txt |  1 +
 3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/babl/babl-types.h b/babl/babl-types.h
index c43ce1a..68c15dd 100644
--- a/babl/babl-types.h
+++ b/babl/babl-types.h
@@ -24,12 +24,10 @@
 #endif
 
 /**
- * Babl:
+ * Babl: (rename-to BablObject)
  *
  * The babl API is based around polymorphism and almost everything is
  * a Babl object.
- *
- * Rename to: Object
  **/
 typedef union _Babl Babl;
 
diff --git a/babl/meson.build b/babl/meson.build
index c57bc93..074f4c4 100644
--- a/babl/meson.build
+++ b/babl/meson.build
@@ -133,3 +133,16 @@ babl = library(
   version: so_version,
   install: true,
 )
+
+if get_option('enable-gir')
+  babl_gir = gnome.generate_gir(babl,
+    sources: babl_headers,
+    extra_args: [
+      '-DBABL_IS_BEING_COMPILED',
+    ],
+    namespace: 'Babl',
+    nsversion: '1',
+    header: 'babl.h',
+    install: true,
+  )
+endif
diff --git a/meson_options.txt b/meson_options.txt
index f4a7ced..eca27be 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,5 +5,6 @@ option('enable-sse3',   type: 'boolean', value: true, description: 'enable SSE3
 option('enable-sse4_1', type: 'boolean', value: true, description: 'enable SSE4.1 support')
 option('enable-avx2',   type: 'boolean', value: true, description: 'enable AVX2 support')
 option('enable-f16c',   type: 'boolean', value: true, description: 'enable hardware half-float support')
+option('enable-gir',    type: 'boolean', value: true, description: 'enable GObject-Introspection (GIR)')
 option('with-docs',     type: 'boolean', value: true, description: 'build website')
 option('with-lcms',     type: 'boolean', value: true, description: 'build with lcms')


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