Skip to content

Commit

Permalink
Merge remote-tracking branch 'opastushkov/topic/opastushkov/use-msvc-…
Browse files Browse the repository at this point in the history
…only-on-windows'

* opastushkov/topic/opastushkov/use-msvc-only-on-windows:
  Throw an error if any compiler except MSCV is used on Windows
  • Loading branch information
timwoj committed Jul 10, 2024
2 parents d996924 + 2c178ab commit db0d527
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CheckCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ 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 ()

0 comments on commit db0d527

Please sign in to comment.