From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@sourcemage.org>
Date: Mon, 28 Sep 2026 00:37:30 +0200
Subject: [PATCH] only require MT32Emu when MT32 support is on

MT-32 emulation is optional in the spell, but the dependency is not: the
find_package for MT32Emu sits with the unconditional ones, so turning
OPT_MT32EMU off only skips the link and still needs the library at
configure time. Look for it only when the support is actually built, the
way the mix target already guards the link.

Upstream-Status: Pending
Signed-off-by: Ismael Luceno <ismael@sourcemage.org>
---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -462,7 +462,9 @@
 find_package(iir REQUIRED)
 find_package(PNG REQUIRED)
 find_package(OpenGL REQUIRED)
-find_package(MT32Emu REQUIRED)
+if (OPT_MT32EMU)
+  find_package(MT32Emu REQUIRED)
+endif()
 find_package(FluidSynth REQUIRED CONFIG)
 if (C_ALSA)
   find_package(ALSA REQUIRED)
-- 
