From 6e2ef0ea7f31936dce5c6c60610eafedf636657f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 13 Oct 2021 15:47:39 +0200 Subject: Meson: Get zlib via wrap --- libcrystfel/meson.build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libcrystfel') diff --git a/libcrystfel/meson.build b/libcrystfel/meson.build index b8dc4b6c..5b10ce14 100644 --- a/libcrystfel/meson.build +++ b/libcrystfel/meson.build @@ -2,12 +2,22 @@ zlibdep = dependency('zlib', required: false) if zlibdep.found() - conf_data.set10('HAVE_ZLIB', 1) if cc.has_function('gzbuffer', prefix: '#include ', dependencies: zlibdep) conf_data.set10('HAVE_GZBUFFER', 1) endif +else + zlibproj = subproject('zlib') + zlibdep = zlibproj.get_variable('zlib_dep') + # Cannot check for gzbuffer in this case, because Zlib won't be built + # until compile time. However, we already know that the wrap version is + # new enough + conf_data.set10('HAVE_GZBUFFER', 1) +endif + +if zlibdep.found() + conf_data.set10('HAVE_ZLIB', 1) endif fftwdep = dependency('fftw3', required: false) -- cgit v1.2.3