diff --git a/CMakeLists.txt b/CMakeLists.txt index c18c48b2d..5535f6d5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,17 @@ if(WIN32 AND MSVC_VERSION LESS 1900) message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)") endif() +# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14. +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test") + endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) + message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org") + endif() +endif() + include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/)