summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorjohnsoch <johnsoch@oregonstate.edu>2017-03-10 08:45:11 +0100
committerMattes D <github@xoft.cz>2017-03-10 08:45:11 +0100
commit9fa8477b73ce878c631ba875ec10746b4143ba75 (patch)
tree09109775a014be05242c7324844d786e20e84e69 /CMakeLists.txt
parentAdded is static flag and removed is static info from text. (#3616) (diff)
downloadcuberite-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 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
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 "")