From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@sourcemage.org>
Date: Mon, 28 Sep 2026 00:37:38 +0200
Subject: [PATCH] link libdosboxcommon against SDL2

libdosboxcommon compiles sources that include <SDL.h>, but nothing links
SDL2 into it: the dosbox executable and libdecoders link it privately, so
its usage requirements never reach libdosboxcommon and the build dies on
a missing SDL.h. Link it there too, the same way the other targets do.

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

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -539,6 +539,7 @@
 endif()
 
 target_link_libraries(libdosboxcommon PRIVATE
+  $<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
   $<IF:$<TARGET_EXISTS:iir::iir>,iir::iir,iir::iir_static>
   loguru
   libdecoders
-- 
