From eb1cac46823520eeadaf22e5be1fe3d3632e6e7e Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Fri, 13 Sep 2019 21:01:18 +0200 Subject: Add support to build vala bindings --- .gitlab-ci.yml | 2 +- meson_options.txt | 2 ++ src/libaccountsservice/meson.build | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64610f4..45abc9e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ build-fedora: image: fedora:latest before_script: - - dnf install -y gcc meson ninja-build gobject-introspection-devel glib-devel gtk-doc gettext-devel make polkit-devel redhat-rpm-config systemd-devel dbus-devel + - dnf install -y gcc meson ninja-build gobject-introspection-devel glib-devel gtk-doc gettext-devel make polkit-devel redhat-rpm-config systemd-devel dbus-devel vala script: - meson -Dgtk_doc=true _build - ninja -C _build all diff --git a/meson_options.txt b/meson_options.txt index 12e2f6b..3aab488 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,5 +10,7 @@ option('systemd', type: 'boolean', value: false, description: 'Use systemd') option('elogind', type: 'boolean', value: false, description: 'Use elogind') option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build') +option('vapi', type: 'boolean', value: true, description : 'Enable Vala bindings for this build') + option('docbook', type: 'boolean', value: false, description: 'build documentation (requires xmlto)') option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation') diff --git a/src/libaccountsservice/meson.build b/src/libaccountsservice/meson.build index 4e134db..615a015 100644 --- a/src/libaccountsservice/meson.build +++ b/src/libaccountsservice/meson.build @@ -95,7 +95,7 @@ pkg.generate( ) if get_option('introspection') - gnome.generate_gir( + as_gir_gen_sources = gnome.generate_gir( libaccountsservice, sources: sources + headers + [enum_sources[1]], includes: ['GObject-2.0', 'Gio-2.0'], @@ -106,4 +106,12 @@ if get_option('introspection') header: join_paths(subdir, 'act.h'), install: true, ) + + if get_option('vapi') + gnome.generate_vapi(act_name, + sources : as_gir_gen_sources[0], + packages : 'gio-2.0', + install : true, + ) + endif endif -- cgit v1.2.3