Skip to content

Commit

Permalink
Server: Backport 0047-Meson-Turn-audio-option-to-a-combo.patch
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Lindqvist <[email protected]>
  • Loading branch information
cazfi committed Oct 2, 2023
1 parent 29df672 commit 17c4cdf
Show file tree
Hide file tree
Showing 3 changed files with 86 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 @@ -23,6 +23,9 @@
# 0036-tile_move_cost_ptrs-Make-cardinal_move-signed.patch
# Unit movemenet handling fix
# osdn #48737
# 0047-Meson-Turn-audio-option-to-a-combo.patch
# Rework disabling audio
# osdn #48757

# Not in the upstream Freeciv server
# ----------------------------------
Expand Down Expand Up @@ -51,6 +54,7 @@ declare -a PATCHLIST=(
"backports/0031-Lua-Always-pass-lua_Integer-to-API_TYPE_INT"
"backports/0042-Meson-Make-manual-generator-build-optional"
"backports/0036-tile_move_cost_ptrs-Make-cardinal_move-signed"
"backports/0047-Meson-Turn-audio-option-to-a-combo"
"meson_webperimental"
"metachange"
"text_fixes"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
From 258d802b11fe6998f1b09581c1923c87499ccd02 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Fri, 29 Sep 2023 20:50:33 +0300
Subject: [PATCH 47/47] Meson: Turn 'audio' option to a combo

See osdn #48757

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

diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson
index 88f8c7af4c..98636a6e01 100644
--- a/doc/INSTALL.meson
+++ b/doc/INSTALL.meson
@@ -147,8 +147,8 @@ 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.
+audio ('none'/'sdl2'):
+ What kind of sound support should be built to the clients. Defaults to sdl2.

tools (array):
Extra tools to build:
diff --git a/meson.build b/meson.build
index ce7ba03070..45663542c9 100644
--- a/meson.build
+++ b/meson.build
@@ -770,7 +770,7 @@ if c_compiler.compiles('''int main(void) { __builtin_unreachable(); return 0; }'
pub_conf_data.set('FREECIV_HAVE_UNREACHABLE', 1)
endif

-if get_option('audio') or get_option('clients').contains('sdl2')
+if get_option('audio') == 'sdl2' or get_option('clients').contains('sdl2')
if host_system == 'windows'
sdl2main_dep = [c_compiler.find_library('mingw32', dirs: cross_lib_path),
c_compiler.find_library('SDL2main', dirs: cross_lib_path),
@@ -781,7 +781,7 @@ if get_option('audio') or get_option('clients').contains('sdl2')
'-s', 'USE_SDL=2'
]

- if get_option('audio')
+ if get_option('audio') == 'sdl2'
emscripten_sdl2_args += [ '-s', 'USE_SDL_MIXER=2' ]
endif

@@ -840,7 +840,7 @@ else
qt_opts = 'cpp_std=c++17'
endif

-if get_option('audio')
+if get_option('audio') != 'none'
priv_conf_data.set('AUDIO_SDL', 1)

if emscripten
diff --git a/meson_options.txt b/meson_options.txt
index f5bb14e456..ac65a3f727 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -46,9 +46,10 @@ option('readline',
description: 'Enable readline functionality')

option('audio',
- type: 'boolean',
- value: true,
- description: 'Build in sound support')
+ type: 'combo',
+ choices: ['none', 'sdl2'],
+ value: 'sdl2',
+ description: 'Sound support type to build')

option('tools',
type: 'array',
--
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 -Dtools=manual \
-Daudio=none -Dtools=manual \
-Dproject-definition=../freeciv-web.fcproj \
-Ddefault_library=static -Dprefix=${HOME}/freeciv \
-Doptimization=3 $EXTRA_MESON_PARAMS
Expand Down

0 comments on commit 17c4cdf

Please sign in to comment.