From 4ec27506cb530c15dbfff30690612aa0b6404d8c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 21 Jul 2022 01:42:25 +0300 Subject: [PATCH 47/47] Meson: Make readline support optional See osdn #45135 Signed-off-by: Marko Lindqvist --- doc/INSTALL.meson | 4 ++++ meson.build | 17 ++++++++++++----- meson_options.txt | 5 +++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson index 99af3deb3c..21ef3bbd12 100644 --- a/doc/INSTALL.meson +++ b/doc/INSTALL.meson @@ -133,6 +133,10 @@ mwand ('try'/'true'/'false') Whether to build against MagickWand to have support for additional mapimg formats. The default is 'try' to enable the support if possible. +readline ('try'/'true'/'false') + Whether to enable readline functionality on server. + The default is 'try' to enable it if suitable readline found. + audio (boolean): Build sound support to the clients. Defaults to true. diff --git a/meson.build b/meson.build index 14fb531026..9735c1f35a 100644 --- a/meson.build +++ b/meson.build @@ -366,11 +366,18 @@ else charset_dep = [] endif -readline_dep = c_compiler.find_library('readline', dirs: cross_lib_path, - required:false) - -if readline_dep.found() - pub_conf_data.set('FREECIV_HAVE_LIBREADLINE', 1) +rl_req = get_option('readline') +if rl_req != 'false' + readline_dep = c_compiler.find_library('readline', dirs: cross_lib_path, + required:false) + + if readline_dep.found() + pub_conf_data.set('FREECIV_HAVE_LIBREADLINE', 1) + elif rl_req == 'true' + error('Readline support requested but not found.') + endif +else + readline_dep = [] endif lzma_dep = c_compiler.find_library('lzma', dirs: cross_lib_path, diff --git a/meson_options.txt b/meson_options.txt index 7c5c925e24..cd3813d0d9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -35,6 +35,11 @@ option('mwand', choices: ['try', 'true', 'false'], description: 'Build MagickWand support to mapimg') +option('readline', + type: 'combo', + choices: ['try', 'true', 'false'], + description: 'Enable readline functionality') + option('audio', type: 'boolean', value: true, -- 2.35.1