From f9b414b55933419e67f18e4e99a95e04b45e3cd9 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Fri, 19 Dec 2025 03:34:21 +0200
Subject: [PATCH 27/42] Meson: Sanity check sdl2/sdl3 audio and
 sdl2/sdl3-client combinations

See RM #1822

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 meson.build | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meson.build b/meson.build
index ad6a6567e3..b1e82e42e7 100644
--- a/meson.build
+++ b/meson.build
@@ -3,6 +3,18 @@ project('freeciv', ['c'],
         version : run_command('fc_version', check : true).stdout(),
         default_options: ['warning_level=1'])
 
+if get_option('audio') == 'sdl2' and get_option('clients').contains('sdl3')
+  error('''sdl3-client and sdl2 audio cannot be enabled simultaneously.
+To build both sdl2-client and sdl3-client with audio support,
+use separate build dirs.''')
+endif
+
+if get_option('audio') == 'sdl3' and get_option('clients').contains('sdl2')
+  error('''sdl2-client and sdl3 audio cannot be enabled simultaneously.
+To build both sdl2-client and sdl3-client with audio support,
+use separate build dirs.''')
+endif
+
 c_compiler = meson.get_compiler('c')
 
 b_root = meson.project_build_root()
-- 
2.51.0

