From 7c880bc1dc602cda0003f66ec2c286b52fc978d3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 30 May 2023 02:10:16 +0300 Subject: [PATCH 13/13] Meson: Fix gzipped saves support See osdn #48101 Signed-off-by: Marko Lindqvist --- gen_headers/meson_freeciv_config.h.in | 3 +++ meson.build | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gen_headers/meson_freeciv_config.h.in b/gen_headers/meson_freeciv_config.h.in index 4b97b60f0f..16a9f19619 100644 --- a/gen_headers/meson_freeciv_config.h.in +++ b/gen_headers/meson_freeciv_config.h.in @@ -120,6 +120,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 e79d5a9c94..df90c6f567 100644 --- a/meson.build +++ b/meson.build @@ -411,6 +411,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) @@ -924,7 +935,7 @@ common_lib = library('freeciv', sources: [specenum, pack_common, tolua_com_a, tolua_com_z, tolua_game, tolua_signal], link_whole: fc_deps, - dependencies: [c_compiler.find_library('z', dirs: cross_lib_path), + dependencies: [zlib_dep, curl_dep, m_dep, sqlite3_dep, icu_dep, net_dep, jansson_dep, lua_dep, lzma_dep, zstd_dep, bcrypt_lib_dep, iconv_lib_dep, -- 2.39.2