From 1b1a7d1e48803b96549d87da1c03f27f5974c4a3 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 10 Oct 2019 16:24:02 +0200 Subject: [PATCH] meson: Simplify libgcrypt detection Meson has native support for the libgcrypt-config program if pkgconfig file is not provided. --- meson.build | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index b796495..2d2abd9 100644 --- a/meson.build +++ b/meson.build @@ -44,23 +44,9 @@ glib_deps = [ dependency('gio-2.0', version: '>=' + min_glib_version), dependency('gio-unix-2.0', version: '>=' + min_glib_version), ] -if with_gcrypt - min_libgcrypt_version = '1.2.2' - gcrypt_dep = dependency('libgcrypt', version: '>=' + min_libgcrypt_version, required: false) - if not gcrypt_dep.found() - libgcrypt_config = find_program('libgcrypt-config') - libgcrypt_version = run_command(libgcrypt_config, '--version').stdout().strip() - if (libgcrypt_version.version_compare('>' + libgcrypt_version)) - error('@0@ requires at least gcrypt version @1@, but version found is @2@' - .format(meson.project_name(), min_libgcrypt_version, libgcrypt_version)) - endif - message('gcrypt version: @0@'.format(libgcrypt_version)) - gcrypt_dep = declare_dependency( - link_args: run_command(libgcrypt_config, '--libs').stdout().strip().split(), - compile_args: run_command(libgcrypt_config, '--cflags').stdout().strip().split(), - ) - endif -endif + +min_libgcrypt_version = '1.2.2' +gcrypt_dep = dependency('libgcrypt', version: '>=1.2.2', required: with_gcrypt) # Libraries math = meson.get_compiler('c').find_library('m')