Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit bf2609e

Browse files
committed
Add a check that the host compiler is modern to CMake, take 1. This is
likely to be reverted and re-applied a few times. The minimum versions we're aiming at: GCC 4.7 Clang 3.1 MSVC 17.0 (Visual Studio 2012) Let me know if something breaks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199145 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 298d1a6 commit bf2609e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cmake/config-ix.cmake

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,25 @@ if (LIBXML2_FOUND)
316316
endif ()
317317
endif ()
318318

319+
option(LLVM_FORCE_USE_OLD_TOOLCHAIN
320+
"Set to ON if you want to force CMake to use a toolchain older than those supported by LLVM."
321+
OFF)
322+
if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN)
323+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
324+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
325+
message(FATAL_ERROR "Host GCC version must be at least 4.7!")
326+
endif()
327+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
328+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
329+
message(FATAL_ERROR "Host Clang version must be at least 3.1!")
330+
endif()
331+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
332+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0)
333+
message(FATAL_ERROR "Host Visual Studio must be at least 2012 (MSVC 17.0)")
334+
endif()
335+
endif()
336+
endif()
337+
319338
include(CheckCXXCompilerFlag)
320339

321340
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)

0 commit comments

Comments
 (0)