From 7a98e406963871530f6cca26bc1b72e034237399 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 30 May 2023 02:10:16 +0300 Subject: [PATCH 34/34] Meson: Fix gzipped saves support See osdn #48101 Signed-off-by: Marko Lindqvist --- gen_headers/meson_freeciv_config.h.in | 3 +++ meson.build | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/gen_headers/meson_freeciv_config.h.in b/gen_headers/meson_freeciv_config.h.in index 466ff08827..9ed5c9d2f9 100644 --- a/gen_headers/meson_freeciv_config.h.in +++ b/gen_headers/meson_freeciv_config.h.in @@ -136,6 +136,9 @@ /* Readline support */ #mesondefine FREECIV_HAVE_LIBREADLINE +/* zlib is available */ +#mesondefine FREECIV_HAVE_LIBZ + /* liblzma is available */ #mesondefine FREECIV_HAVE_LIBLZMA diff --git a/meson.build b/meson.build index 5d1829da09..89a167ec43 100644 --- a/meson.build +++ b/meson.build @@ -472,6 +472,17 @@ else lzma_dep = [] endif +zlib_dep = c_compiler.find_library('z', dirs: cross_lib_path, + required:true) + +if zlib_dep.found() + pub_conf_data.set('FREECIV_HAVE_LIBZ', 1) +endif + +if not c_compiler.has_header('zlib.h', args: header_arg) + error('Mandatory header zlib.h not found!') +endif + zstd_dep = c_compiler.find_library('zstd', dirs: cross_lib_path, required:false) -- 2.39.2