summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--daemon/meson.build2
-rw-r--r--meson.build27
-rw-r--r--meson_options.txt1
3 files changed, 18 insertions, 12 deletions
diff --git a/daemon/meson.build b/daemon/meson.build
index 606d83f4..a31f5f6e 100644
--- a/daemon/meson.build
+++ b/daemon/meson.build
@@ -525,7 +525,7 @@ if enable_afp
sources = common_sources + files('gvfsbackendafp.c')
deps = []
- if have_gcrypt
+ if enable_gcrypt
deps += libgcrypt_dep
endif
diff --git a/meson.build b/meson.build
index 913355d9..07eff014 100644
--- a/meson.build
+++ b/meson.build
@@ -249,20 +249,25 @@ libxml_dep = dependency('libxml-2.0', required: false)
have_libxml = libxml_dep.found()
# *** Check for libgcrypt ***
-libgcrypt_config = find_program('libgcrypt-config')
-libgcrypt_version = run_command(libgcrypt_config, '--version').stdout().strip()
+enable_gcrypt = get_option('enable-gcrypt')
+if enable_gcrypt
+ libgcrypt_req_version = '>= 1.2.2'
-libgcrypt_cflags = run_command(libgcrypt_config, '--cflags').stdout().strip().split()
-libgcrypt_libs = run_command(libgcrypt_config, '--libs').stdout().strip().split()
+ libgcrypt_config = find_program('libgcrypt-config')
+ libgcrypt_version = run_command(libgcrypt_config, '--version').stdout().strip()
-libgcrypt_dep = declare_dependency(
- compile_args: libgcrypt_cflags,
- link_args: libgcrypt_libs,
- version: libgcrypt_version
-)
+ assert(libgcrypt_version.version_compare(libgcrypt_req_version), 'gcrypt required but libgcrypt ' + libgcrypt_req_version + ' not found')
+
+ libgcrypt_cflags = run_command(libgcrypt_config, '--cflags').stdout().strip().split()
+ libgcrypt_libs = run_command(libgcrypt_config, '--libs').stdout().strip().split()
-have_gcrypt = libgcrypt_version.version_compare('>= 1.2.2')
-config_h.set('HAVE_GCRYPT', have_gcrypt)
+ libgcrypt_dep = declare_dependency(
+ compile_args: libgcrypt_cflags,
+ link_args: libgcrypt_libs,
+ version: libgcrypt_version
+ )
+endif
+config_h.set('HAVE_GCRYPT', enable_gcrypt)
# *** Check for dbus service dir ***
dbus_service_dir = get_option('with-dbus-service-dir')
diff --git a/meson_options.txt b/meson_options.txt
index 833b7d79..205bb61f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -22,6 +22,7 @@ option('enable-udisks2', type: 'boolean', value: true, description: 'build with
option('enable-bluray', type: 'boolean', value: true, description: 'build with bluray metadata support')
option('enable-fuse', type: 'boolean', value: true, description: 'build with fuse support')
option('enable-gcr', type: 'boolean', value: true, description: 'build with gcr certificate support')
+option('enable-gcrypt', type: 'boolean', value: true, description: 'build with gcrypt support')
option('enable-gudev', type: 'boolean', value: true, description: 'build with gudev device support')
option('enable-keyring', type: 'boolean', value: true, description: 'build with keyring support')
option('enable-logind', type: 'boolean', value: true, description: 'build with logind support')