From ee7fa80d9a8b97801b126692ec8ec24f85585c0f Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 27 Apr 2023 14:26:10 +0200
Subject: [PATCH] [cmake] Added generator check for Windows wheels.

---
 scripts/cmake/CMakeSetup.cmake | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/cmake/CMakeSetup.cmake b/scripts/cmake/CMakeSetup.cmake
index 2f7790bd8ad..c4934c16b57 100644
--- a/scripts/cmake/CMakeSetup.cmake
+++ b/scripts/cmake/CMakeSetup.cmake
@@ -9,6 +9,13 @@ if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
     )
 endif()
 
+message(STATUS "Generator: ${CMAKE_GENERATOR}")
+if(WIN32 AND (NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+   AND "$ENV{CIBUILDWHEEL}"
+)
+    message(FATAL_ERROR "Wheels only build in Visual Studio!")
+endif()
+
 set(_collection ${PROJECT_SOURCE_DIR}/ThirdParty/collection)
 # If submodules in ThirdParty/collection are initialized and this is a Guix
 # build use submodule as CPM sources.
-- 
GitLab