From a9a0e90fef6d137a1f93bbdc0370f9b6e6edf84c Mon Sep 17 00:00:00 2001 From: Oleksandr Pastushkov Date: Tue, 18 Jun 2024 22:24:01 +0300 Subject: [PATCH] Throw an error if any compiler except MSCV is used on Windows --- CheckCompilers.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CheckCompilers.cmake b/CheckCompilers.cmake index b746e2a..a8ec9f1 100644 --- a/CheckCompilers.cmake +++ b/CheckCompilers.cmake @@ -9,3 +9,11 @@ endif () if (NOT CMAKE_CXX_COMPILER AND DEFINED CMAKE_CXX_COMPILER) message(FATAL_ERROR "Could not find prerequisite C++ compiler") endif () + +if (WIN32 AND NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC") + message(FATAL_ERROR "Could not find prerequisite C compiler for Windows platform. MSVC is required") +endif () + +if (WIN32 AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + message(FATAL_ERROR "Could not find prerequisite C++ compiler for Windows platform. MSVC is required") +endif ()