Skip to content

Commit

Permalink
cmake: build SDL2_image 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 4a28594 commit a0d0e1b
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 @@ -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
Expand Down

0 comments on commit a0d0e1b

Please sign in to comment.