From a0d0e1b5a21e4d3ded4bc58e1b1893cc2e17c3bf Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 3 Jan 2025 23:57:27 +0100 Subject: [PATCH] cmake: build SDL2_image 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 0d86d261f..1d7377991 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -248,6 +248,9 @@ if(WIN32 AND SDL2IMAGE_BUILD_SHARED_LIBS) target_sources(SDL2_image PRIVATE src/version.rc ) + if(MINGW) + target_link_options(SDL2_image PRIVATE -static-libgcc) + endif() endif() set_target_properties(SDL2_image PROPERTIES DEFINE_SYMBOL DLL_EXPORT