diff options
author | johnsoch <johnsoch@oregonstate.edu> | 2017-03-10 08:45:11 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-03-10 08:45:11 +0100 |
commit | 9fa8477b73ce878c631ba875ec10746b4143ba75 (patch) | |
tree | 09109775a014be05242c7324844d786e20e84e69 /CMakeLists.txt | |
parent | Added is static flag and removed is static info from text. (#3616) (diff) | |
download | cuberite-9fa8477b73ce878c631ba875ec10746b4143ba75.tar cuberite-9fa8477b73ce878c631ba875ec10746b4143ba75.tar.gz cuberite-9fa8477b73ce878c631ba875ec10746b4143ba75.tar.bz2 cuberite-9fa8477b73ce878c631ba875ec10746b4143ba75.tar.lz cuberite-9fa8477b73ce878c631ba875ec10746b4143ba75.tar.xz cuberite-9fa8477b73ce878c631ba875ec10746b4143ba75.tar.zst cuberite-9fa8477b73ce878c631ba875ec10746b4143ba75.zip |
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 169f06e71..a1b154aa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,18 @@ if(MSVC OR MSVC_IDE) set(CMAKE_GENERATOR_TOOLSET "v120_CTP_Nov2012" CACHE STRING "Platform Toolset" FORCE) else() # VC12+, assuming C++11 supported. endif() +else() # GCC or Clang, so get compiler version directly since CMAKE_CXX_COMPILER_VERSION is only available in CMake 2.8.8 and later + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE DUMPED_COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) + + # Check for gcc version 4.8 or greater + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND DUMPED_COMPILER_VERSION VERSION_LESS "4.8") + message(FATAL_ERROR "You have ${CMAKE_CXX_COMPILER_ID} version ${DUMPED_COMPILER_VERSION}, but at least 4.8 is needed") + endif() + + # Check for clang version 3.4 or greater + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND DUMPED_COMPILER_VERSION VERSION_LESS "3.4") + message(FATAL_ERROR "You have ${CMAKE_CXX_COMPILER_ID} version ${DUMPED_COMPILER_VERSION}, but at least 3.4 is needed") + endif() endif() set(BUILD_TOOLS OFF CACHE BOOL "") |