diff -urN gmsh-4.11.1-source/CMakeLists.txt.orig gmsh-4.11.1-source/CMakeLists.txt
--- gmsh-4.11.1-source/CMakeLists.txt.orig	2022-12-20 16:30:55.000000000 +0100
+++ gmsh-4.11.1-source/CMakeLists.txt	2023-01-01 12:57:24.772609300 +0100
@@ -1693,9 +1693,13 @@
   set_target_properties(shared PROPERTIES OUTPUT_NAME gmsh
      VERSION ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}
      SOVERSION ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION})
-  if(WIN32)
+  if(MSVC)
     set_target_properties(shared PROPERTIES PREFIX "" IMPORT_PREFIX ""
-      IMPORT_SUFFIX ".lib" COMPILE_FLAGS "-DGMSH_DLL -DGMSH_DLL_EXPORT")
+      IMPORT_SUFFIX ".lib")
+  endif()
+  if(WIN32)
+    set_target_properties(shared PROPERTIES
+      COMPILE_FLAGS "-DGMSH_DLL -DGMSH_DLL_EXPORT")
   elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
     if(NOT ENABLE_PRIVATE_API)
       # hide all symbols by default (if not exporting the private API); symbols to
