From a21a1b30227a9ab9d84784dd153f5d01044efa48 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 25 Feb 2022 06:50:48 +0200 Subject: [PATCH 48/48] Meson: Support building Windows sdl2-client when audio disabled See osdn #43923 Signed-off-by: Marko Lindqvist --- meson.build | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index b82eb85e0c..ff3e7f75a8 100644 --- a/meson.build +++ b/meson.build @@ -368,18 +368,22 @@ int main(void) { size_t var = 0; fr("''' + format + '''", var); return 0; }''', endif endforeach -if get_option('audio') - priv_conf_data.set('AUDIO_SDL', 1) - +if get_option('audio') or get_option('clients').contains('sdl2') if host_system == 'windows' - audio_dep = [c_compiler.find_library('libmingw32', dirs: cross_lib_path), - c_compiler.find_library('libSDL2main', dirs: cross_lib_path), - c_compiler.find_library('libSDL2', dirs: cross_lib_path), - c_compiler.find_library('libSDL2_mixer', dirs: cross_lib_path)] + sdl2main_dep = [c_compiler.find_library('libmingw32', dirs: cross_lib_path), + c_compiler.find_library('libSDL2main', dirs: cross_lib_path), + c_compiler.find_library('libSDL2', dirs: cross_lib_path)] else - audio_dep = [c_compiler.find_library('libSDL2', dirs: cross_lib_path), - c_compiler.find_library('libSDL2_mixer', dirs: cross_lib_path)] + sdl2main_dep = [c_compiler.find_library('libSDL2', dirs: cross_lib_path)] endif +endif + +if get_option('audio') + priv_conf_data.set('AUDIO_SDL', 1) + + audio_sdl2_dep = c_compiler.find_library('libSDL2_mixer', + dirs: cross_lib_path) + audio_dep = [sdl2main_dep, audio_sdl2_dep] else audio_dep = [] endif @@ -2760,8 +2764,7 @@ executable('freeciv-sdl2', 'client/gui-sdl2/wldlg.c', clienticon, include_directories: client_inc, - dependencies: [c_compiler.find_library('libSDL2', dirs: cross_lib_path), - c_compiler.find_library('libSDL2_mixer', dirs: cross_lib_path), + dependencies: [sdl2main_dep, audio_dep, c_compiler.find_library('libSDL2_image', dirs: cross_lib_path), c_compiler.find_library('libSDL2_gfx', dirs: cross_lib_path), c_compiler.find_library('libSDL2_ttf', dirs: cross_lib_path), -- 2.34.1