SDL_ttf: cmake: build SDL2_ttf.dll with -static-libgcc when using MinGW toolchain

From 3091df328802d15364a30b8fbd5e8f58ce770f9b Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sat, 4 Jan 2025 00:00:18 +0100
Subject: [PATCH] cmake: build SDL2_ttf.dll with -static-libgcc when using
 MinGW toolchain

This avoids a runtime dependency on libgcc_x_seh-1.dll (or a similarly named library)
---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c85f20c..aff9669d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -109,6 +109,9 @@ if(WIN32 AND SDL2TTF_BUILD_SHARED_LIBS)
     target_sources(SDL2_ttf PRIVATE
         version.rc
     )
+    if(MINGW)
+        target_link_options(SDL2_ttf PRIVATE -static-libgcc)
+    endif()
 endif()
 set_target_properties(SDL2_ttf PROPERTIES
     DEFINE_SYMBOL DLL_EXPORT