From e1463203257b8244d738f0b23266eb782e98f664 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Fri, 19 Dec 2025 03:34:21 +0200
Subject: [PATCH 41/41] 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..aa5c1fe062 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

