Skip to content

Commit

Permalink
Server: Backport 0021-Meson-Replace-boolean-ruledit-option-with-tools…
Browse files Browse the repository at this point in the history
…-arra.patch

Signed-off-by: Marko Lindqvist <[email protected]>
  • Loading branch information
cazfi committed Sep 26, 2023
1 parent 93ec5c5 commit c46e46a
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
4 changes: 4 additions & 0 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# 0022-Lua-Fix-Unit-is_on_possible_city_tile.patch
# Fix finding cities from huts
# osdn #48582
# 0021-Meson-Replace-boolean-ruledit-option-with-tools-arra.patch
# Refactored meson options
# osdn #48700

# Not in the upstream Freeciv server
# ----------------------------------
Expand All @@ -35,6 +38,7 @@ declare -a GIT_PATCHLIST=(
declare -a PATCHLIST=(
"backports/0022-AI-Set-countdown-correctly-if-senate-blocks-war-comp"
"backports/0022-Lua-Fix-Unit-is_on_possible_city_tile"
"backports/0021-Meson-Replace-boolean-ruledit-option-with-tools-arra"
"meson_webperimental"
"metachange"
"text_fixes"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
From e8e49eee1f6ca145c860258e1e46702418e262fc Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Fri, 22 Sep 2023 14:38:54 +0300
Subject: [PATCH 21/21] Meson: Replace boolean 'ruledit' option with 'tools'
array

See osdn #48700

Signed-off-by: Marko Lindqvist <[email protected]>
---
doc/INSTALL.meson | 6 ++++--
meson.build | 4 ++--
meson_options.txt | 9 +++++----
3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson
index 3202b36922..91092f7fd9 100644
--- a/doc/INSTALL.meson
+++ b/doc/INSTALL.meson
@@ -150,8 +150,10 @@ readline ('try'/'true'/'false')
audio (boolean):
Build sound support to the clients. Defaults to true.

-ruledit (boolean):
- Build ruleset editor. Defaults to true.
+tools (array):
+ Extra tools to build:
+ * ruledit : Ruleset editor
+ Default is to build them all.

nls (boolean):
Build in Native Language Support. Defaults to true.
diff --git a/meson.build b/meson.build
index b01e924b89..4bc117c207 100644
--- a/meson.build
+++ b/meson.build
@@ -5,7 +5,7 @@ c_compiler = meson.get_compiler('c')

b_root = meson.project_build_root()

-if get_option('ruledit') or \
+if get_option('tools').contains('ruledit') or \
get_option('clients').contains('qt') or \
get_option('fcmp').contains('qt')
add_languages('cpp', native: false)
@@ -4093,7 +4093,7 @@ executable('freeciv-ruleup',
install: true
)

-if get_option('ruledit')
+if get_option('tools').contains('ruledit')

if not qt_dep.found()
if qtver == 'qt6' or qtver == 'qt6x'
diff --git a/meson_options.txt b/meson_options.txt
index 40134d50d8..83500a504c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,10 +50,11 @@ option('audio',
value: true,
description: 'Build in sound support')

-option('ruledit',
- type: 'boolean',
- value: true,
- description: 'Build ruleset editor')
+option('tools',
+ type: 'array',
+ choices: ['ruledit'],
+ value: ['ruledit'],
+ description: 'Extra tools to build')

option('nls',
type: 'boolean',
--
2.40.1

2 changes: 1 addition & 1 deletion freeciv/prepare_freeciv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mkdir -p build
( cd build
meson setup ../freeciv -Dserver='freeciv-web' \
-Dclients=[] -Dfcmp=cli -Djson-protocol=true -Dnls=false \
-Daudio=false -Druledit=false \
-Daudio=false -Dtools=[] \
-Dproject-definition=../freeciv-web.fcproj \
-Ddefault_library=static -Dprefix=${HOME}/freeciv \
-Doptimization=3 $EXTRA_MESON_PARAMS
Expand Down

0 comments on commit c46e46a

Please sign in to comment.