From b7f960bfd90120a35d8198cd4391c4a93c100b52 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 24 Jun 2023 08:01:38 +0300 Subject: [PATCH 23/23] Meson: Add dev-save-compat support See osdn #45610 Signed-off-by: Marko Lindqvist --- bootstrap/freeciv.fcproj | 3 +++ gen_headers/meson_fc_config.h.in | 9 +++++++++ meson.build | 9 +++++++++ 3 files changed, 21 insertions(+) diff --git a/bootstrap/freeciv.fcproj b/bootstrap/freeciv.fcproj index 1b021a2b42..a962132783 100644 --- a/bootstrap/freeciv.fcproj +++ b/bootstrap/freeciv.fcproj @@ -18,3 +18,6 @@ FREECIV_DEFAULT_PORT=5556 # Uncomment if you want extended/testmatic logging # FREECIV_TESTMATIC=yes + +# Uncomment to be able load recent development (unstable) savegame formats +# FREECIV_DEV_SAVE_COMPAT=yes diff --git a/gen_headers/meson_fc_config.h.in b/gen_headers/meson_fc_config.h.in index a83c969868..c9f8215c8f 100644 --- a/gen_headers/meson_fc_config.h.in +++ b/gen_headers/meson_fc_config.h.in @@ -77,6 +77,15 @@ /* Can run programs as root */ #mesondefine ALWAYS_ROOT +/* Development version save game compatibility */ +#mesondefine FREECIV_DEV_SAVE_COMPAT + +#ifdef FREECIV_DEV_SAVE_COMPAT +/* Current development versions */ +#define FREECIV_DEV_SAVE_COMPAT_3_3 +#define FREECIV_DEV_SAVE_COMPAT_3_2 +#endif /* FREECIV_DEV_SAVE_COMPAT */ + /* Have magickwand mapimg toolkit */ #mesondefine HAVE_MAPIMG_MAGICKWAND diff --git a/meson.build b/meson.build index d24a3711da..0d206bcf4b 100644 --- a/meson.build +++ b/meson.build @@ -17,6 +17,7 @@ mp_list_url = '' storage_dir = '' default_port = '' testmatic = '' +dev_save_compat = '' proj_def = get_option('project-definition') if proj_def != '' @@ -34,6 +35,8 @@ if proj_def != '' default_port = item.substring(21) elif item.startswith('FREECIV_TESTMATIC') testmatic = item.substring(18) + elif item.startswith('FREECIV_DEV_SAVE_COMPAT') + dev_save_compat = item.substring(24) elif not item.startswith('#') and item != '' error('Unknown parameter ' + item + ' in project definition') endif @@ -64,6 +67,12 @@ elif testmatic != '' and testmatic != 'no' error('Unknown testmatic value ' + testmatic) endif +if dev_save_compat == 'yes' + priv_conf_data.set('FREECIV_DEV_SAVE_COMPAT', 1) +elif dev_save_compat != '' and dev_save_compat != 'no' + error('Unknown dev_save_compat value ' + dev_save_compat) +endif + priv_conf_data.set('BINDIR', join_paths(get_option('prefix'), get_option('bindir'))) -- 2.40.1