diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-01-13 21:47:35 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-01-13 21:47:35 +0000 |
commit | bf2609e264a6903b9b4bfaa42fcc04338caa2abb (patch) | |
tree | 8bf0d6020d7970fce48fcce83e7bf9a4eabaad10 /cmake | |
parent | 298d1a6b210a07108a322e91c50a0abf2a292f25 (diff) | |
download | llvm-bf2609e264a6903b9b4bfaa42fcc04338caa2abb.tar.gz llvm-bf2609e264a6903b9b4bfaa42fcc04338caa2abb.tar.bz2 llvm-bf2609e264a6903b9b4bfaa42fcc04338caa2abb.tar.xz |
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
Diffstat (limited to 'cmake')
-rwxr-xr-x | cmake/config-ix.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index dc991a23be..7b2b005bb9 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -316,6 +316,25 @@ if (LIBXML2_FOUND) endif () endif () +option(LLVM_FORCE_USE_OLD_TOOLCHAIN + "Set to ON if you want to force CMake to use a toolchain older than those supported by LLVM." + OFF) +if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + message(FATAL_ERROR "Host GCC version must be at least 4.7!") + endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1) + message(FATAL_ERROR "Host Clang version must be at least 3.1!") + endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + message(FATAL_ERROR "Host Visual Studio must be at least 2012 (MSVC 17.0)") + endif() + endif() +endif() + include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG) |