SDL_mixer: cmake: build SDL2_mixer.dll with -static-libgcc when using MinGW toolchain (70260)

From 70260c337519ebbd329464ceabbef3a4258bc8f6 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 3 Jan 2025 23:58:41 +0100
Subject: [PATCH] cmake: build SDL2_mixer.dll with -static-libgcc when using
 MinGW toolchain

This avoids a runtime dependency on libgcc_x_seh-1.dll (or a similarly named library)

(cherry picked from commit ffbdface7b9e4c9c76952724efc6d7ed5e7fc842)
---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0ba8ba8..22b1e2b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -260,6 +260,9 @@ if(WIN32 AND BUILD_SHARED_LIBS)
     target_sources(SDL2_mixer PRIVATE
         version.rc
     )
+    if(MINGW)
+        target_link_options(SDL2_mixer PRIVATE -static-libgcc)
+    endif()
 endif()
 set_target_properties(SDL2_mixer PROPERTIES
     DEFINE_SYMBOL DLL_EXPORT