Commit 1b1a7d1e authored by Daiki Ueno's avatar Daiki Ueno

meson: Simplify libgcrypt detection

Meson has native support for the libgcrypt-config program if pkgconfig
file is not provided.
parent 4b6d735b
......@@ -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')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment