SDL_mixer: cmake: Fix windows DLL

From ffd05891bcaca5c42cfd70ce940af3cd8f44dfbf Mon Sep 17 00:00:00 2001
From: Charlie Birks <[EMAIL REDACTED]>
Date: Tue, 14 Dec 2021 10:59:50 +0000
Subject: [PATCH] cmake: Fix windows DLL

---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d699e35b..8c5490b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,5 +88,9 @@ if (SUPPORT_MID_TIMIDITY)
     target_link_libraries(SDL2_mixer PRIVATE timidity)
 endif()
 
+if(WIN32 AND BUILD_SHARED_LIBS)
+  target_compile_definitions(SDL2_mixer PRIVATE -DDLL_EXPORT)
+endif()
+
 target_include_directories(SDL2_mixer PUBLIC include)
 target_link_libraries(SDL2_mixer PRIVATE SDL2::SDL2)