--- cmake-3.21.0/Source/cmake.cxx.orig	2021-07-19 20:15:00.027000000 +0200
+++ cmake-3.21.0/Source/cmake.cxx	2021-07-19 20:16:17.719000700 +0200
@@ -2179,7 +2179,10 @@
       return gen;
     }
   }
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW)
+#if defined(_WIN32) && defined(__MINGW32__) && !defined(CMAKE_BOOT_MINGW)
+  return std::unique_ptr<cmGlobalGenerator>(
+    cm::make_unique<cmGlobalNinjaGenerator>(this));
+#elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW)
   std::string found;
   // Try to find the newest VS installed on the computer and
   // use that as a default if -G is not specified
