From 3ec8f4a7f5ae83089b5f693fb97d3eb384aa33d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 3 Oct 2019 19:49:25 +0200 Subject: [PATCH] Win32: Disable dynamic libgcc for MinGW DLL --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80ee9691..06867308 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -125,6 +125,10 @@ target_compile_options(glfw PRIVATE if (BUILD_SHARED_LIBS) if (WIN32) if (MINGW) + # Remove the dependency on the shared version of libgcc + # NOTE: MinGW-w64 has the correct default but MinGW needs this + target_link_options(glfw PRIVATE "-static-libgcc") + # Remove the lib prefix on the DLL (but not the import library) set_target_properties(glfw PROPERTIES PREFIX "")