From 30e94b9cba8f8210c39443e09d9c978495909e84 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 26 Jan 2023 04:52:21 +0200 Subject: [PATCH 34/34] Meson: Check lzma.h availability for FREECIV_HAVE_LIBLZMA Reported by ddeanbrown See osdn #46599 Signed-off-by: Marko Lindqvist --- meson.build | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index d00cad3b7d..8c5704887c 100644 --- a/meson.build +++ b/meson.build @@ -233,7 +233,6 @@ priv_headers = [ 'fcntl.h', 'time.h', 'libgen.h', - 'lzma.h', 'zstd.h', 'memory.h', 'netdb.h', @@ -427,11 +426,15 @@ else readline_dep = [] endif -lzma_dep = c_compiler.find_library('lzma', dirs: cross_lib_path, - required:false) +if c_compiler.has_header('lzma.h', args: header_arg) + priv_conf_data.set('HAVE_LZMA_H', 1) + + lzma_dep = c_compiler.find_library('lzma', dirs: cross_lib_path, + required:false) -if lzma_dep.found() - pub_conf_data.set('FREECIV_HAVE_LIBLZMA', 1) + if lzma_dep.found() + pub_conf_data.set('FREECIV_HAVE_LIBLZMA', 1) + endif endif zstd_dep = c_compiler.find_library('zstd', dirs: cross_lib_path, -- 2.39.0