diff -urN gmsh-gmsh_4_10_2/CMakeLists.txt.orig gmsh-gmsh_4_10_2/CMakeLists.txt
--- gmsh-gmsh_4_10_2/CMakeLists.txt.orig	2022-05-22 03:21:54.249868800 +0200
+++ gmsh-gmsh_4_10_2/CMakeLists.txt	2022-05-22 03:24:20.743510100 +0200
@@ -218,8 +218,6 @@
       set(GMSH_OS "Windows")
       set(WIN32 1)
       add_definitions(-DWIN32)
-      set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
-      set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".so" ".lib" ".LIB" ".dll" ".DLL" ".dll.a")
     endif()
   endif()
 else()
@@ -1717,7 +1715,7 @@
 
 # Windows specific linker options
 if(WIN32 AND NOT MSVC)
-  set(FLAGS "-Wl,--stack,16777216 -Wl,--image-base -Wl,0x10000000 -static")
+  set(FLAGS "-Wl,--stack,16777216 -Wl,--image-base -Wl,0x10000000")
   if(HAVE_FLTK)
     set(APPFLAGS "${FLAGS} -municode -mwindows")
     if(HAVE_64BIT_SIZE_T)
@@ -1729,7 +1727,7 @@
     set(APPFLAGS "${FLAGS} -municode -mconsole")
   endif()
   set_target_properties(gmsh PROPERTIES LINK_FLAGS "${APPFLAGS}")
-  if(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
+  if(NOT (ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED))
     set_target_properties(shared PROPERTIES LINK_FLAGS "${FLAGS}")
   endif()
   # remove -Wl,-Bdynamic flags
