Skip to content

Commit

Permalink
cmake: build SDL2_net.dll with -static-libgcc when using MinGW toolchain
Browse files Browse the repository at this point in the history
This avoids a runtime dependency on libgcc_x_seh-1.dll (or a similarly named library)
  • Loading branch information
madebr committed Jan 3, 2025
1 parent 9696288 commit 17a3a53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 17a3a53

Please sign in to comment.