[llvm] r199145 - Add a check that the host compiler is modern to CMake, take 1. This is
Chandler Carruth
chandlerc at gmail.com
Mon Jan 13 13:47:35 PST 2014
Author: chandlerc
Date: Mon Jan 13 15:47:35 2014
New Revision: 199145
URL: http://llvm.org/viewvc/llvm-project?rev=199145&view=rev
Log:
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!
Modified:
llvm/trunk/cmake/config-ix.cmake
Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=199145&r1=199144&r2=199145&view=diff
==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Mon Jan 13 15:47:35 2014
@@ -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)
More information about the llvm-commits
mailing list