[gnome-online-accounts/wip/jfelder/add-goabackend-introspection: 74/74] build: Add introspection support for goabackend



commit 110616e68c030efd67549a03a5fbdefec3008bb1
Author: Jean Felder <jfelder src gnome org>
Date:   Sat Sep 14 16:46:48 2019 +0200

    build: Add introspection support for goabackend
    
    The autotools part was done by Andrea Azzarone.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792865

 src/goabackend/Makefile.am | 29 +++++++++++++++++++++++++++++
 src/goabackend/meson.build | 24 ++++++++++++++++++++++++
 2 files changed, 53 insertions(+)
---
diff --git a/src/goabackend/Makefile.am b/src/goabackend/Makefile.am
index 83852378..d3725567 100644
--- a/src/goabackend/Makefile.am
+++ b/src/goabackend/Makefile.am
@@ -1,7 +1,9 @@
+-include $(INTROSPECTION_MAKEFILE)
 
 NULL =
 CLEANFILES =
 EXTRA_DIST =
+INTROSPECTION_GIRS =
 
 AM_CPPFLAGS =                                                  \
        -I$(top_builddir)/src -I$(top_srcdir)/src               \
@@ -216,6 +218,33 @@ pkgconfig_DATA = goa-backend-1.0.pc
 
 # ----------------------------------------------------------------------------------------------------
 
+if HAVE_INTROSPECTION
+introspection_sources =                                                \
+       $(libgoa_backend_1_0_la_HEADERS)                        \
+       goabackendenumtypes.c                                   \
+       goaprovider.c
+
+GoaBackend-1.0.gir: libgoa-backend-1.0.la
+GoaBackend_1_0_gir_INCLUDES = Gio-2.0 Gtk-3.0 Goa-1.0
+GoaBackend_1_0_gir_EXPORT_PACKAGES = goa-backend-1.0
+GoaBackend_1_0_gir_LIBS = goa-backend-1.0
+GoaBackend_1_0_gir_FILES = $(introspection_sources)
+GoaBackend_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(libgoa_backend_1_0_la_CFLAGS)
+GoaBackend_1_0_gir_SCANNERFLAGS = $(WARN_SCANNERFLAGS) --c-include='goabackend/goabackend.h' 
--identifier-prefix=Goa
+INTROSPECTION_GIRS += GoaBackend-1.0.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = GoaBackend-1.0.gir
+
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = GoaBackend-1.0.typelib
+
+CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+
+endif # HAVE_INTROSPECTION
+
+# ----------------------------------------------------------------------------------------------------
+
 CLEANFILES += \
        $(BUILT_SOURCES) \
        $(enum_built_sources) \
diff --git a/src/goabackend/meson.build b/src/goabackend/meson.build
index 3d9dee8b..83fcff1c 100644
--- a/src/goabackend/meson.build
+++ b/src/goabackend/meson.build
@@ -147,6 +147,30 @@ pkg.generate(
   variables: 'exec_prefix=${prefix}'
 )
 
+if enable_introspection
+  libgoa_backend_gir = gnome.generate_gir(
+    libgoa_backend,
+    sources: enum_sources + files('goaprovider.c') + headers,
+    includes: ['Gio-2.0', 'Goa-1.0', 'Gtk-3.0'],
+    nsversion: goa_api_version,
+    namespace: 'GoaBackend',
+    identifier_prefix: goa_ns,
+    export_packages: goa_backend_api_name,
+    extra_args: ['-DGOA_BACKEND_COMPILATION', '-DGOA_API_IS_SUBJECT_TO_CHANGE'],
+    header: join_paths('goabackend', 'goabackend.h'),
+    install: true
+  )
+
+  if enable_vapi
+    gnome.generate_vapi(
+      goa_backend_api_name,
+      sources: libgoa_backend_gir[0],
+      packages: ['gio-2.0', 'goa-1.0', 'gtk+-3.0'],
+      install: true
+    )
+  endif
+endif
+
 libgoawebextension_sources = files(
   'goawebextension.c',
   'goawebextensionmain.c'


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