From 17a3a532d0340dccbe94687cbe3e5ec32e73f29c Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 4 Jan 2025 00:01:17 +0100 Subject: [PATCH] cmake: build SDL2_net.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 291959e..e04cefd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,9 @@ if(WIN32) if(SDL2NET_BUILD_SHARED_LIBS) target_sources(SDL2_net PRIVATE src/version.rc) endif() + if(MINGW) + target_link_options(SDL2_net PRIVATE -static-libgcc) + endif() endif() set_target_properties(SDL2_net PROPERTIES DEFINE_SYMBOL DLL_EXPORT