summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2018-02-15 15:00:58 +0100
committerTomas Popela <tpopela@redhat.com>2018-04-11 12:39:20 +0200
commit05d543fe0ca867faf79cb8819481abdc7bc72105 (patch)
treee1997c8b742afe6769a82f0909d993d6483a4267
parent63de523094465145ce18ea63a70e8fb708faeef5 (diff)
downloadlibsoup-05d543fe0ca867faf79cb8819481abdc7bc72105.tar.gz
Check for presence of g-ir-scanner and vala if they're enabled
Took inspiration from libgit2-glib project.
-rw-r--r--libsoup/meson.build4
-rw-r--r--meson.build17
2 files changed, 19 insertions, 2 deletions
diff --git a/libsoup/meson.build b/libsoup/meson.build
index f23d3383..279feadd 100644
--- a/libsoup/meson.build
+++ b/libsoup/meson.build
@@ -251,7 +251,7 @@ if enable_gnome
variables: 'exec_prefix=${prefix}')
endif
-if get_option('introspection') or get_option('vapi')
+if enable_introspection or enable_vapi
gir_args = libsoup_c_args + ['-DLIBSOUP_USE_UNSTABLE_REQUEST_API']
soup_ns = 'Soup'
@@ -274,7 +274,7 @@ if get_option('introspection') or get_option('vapi')
dependencies : deps,
sources : soup_gir_gen_sources)
- if get_option('vapi')
+ if enable_vapi
gnome.generate_vapi(libsoup_api_name,
sources : soup_gir_gen_sources[0],
packages : 'gio-2.0',
diff --git a/meson.build b/meson.build
index 0f3a22e5..687e7273 100644
--- a/meson.build
+++ b/meson.build
@@ -213,6 +213,23 @@ if host_machine.system() == 'windows'
enable_gnome = false
endif
+#########################
+# GObject introspection #
+#########################
+enable_introspection = get_option('introspection')
+if enable_introspection
+ enable_introspection = find_program('g-ir-scanner', required: false).found() and not meson.is_cross_build()
+endif
+
+############
+# Vala API #
+############
+enable_vapi = get_option('vapi')
+if enable_vapi
+ assert(enable_gir, 'vapi support was requested, but introspection support is mandatory.')
+ assert(add_languages('vala', required: false), 'vapi support was requested, but vala not found.')
+endif
+
configinc = include_directories('.')
prefix = get_option('prefix')