From: Marcin Juszkiewicz Date: Tue, 16 Oct 2018 11:18:08 +0000 (+0200) Subject: cmake: mark gcc 7 as minimum C++ compiler (due to std++17) X-Git-Tag: v14.1.0~1166^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24615%2Fhead;p=ceph.git cmake: mark gcc 7 as minimum C++ compiler (due to std++17) Ceph requires C++17 support from compiler. This means gcc 7.x being minimal version supported. This also allows to fail quick on Debian 'stretch' with it's gcc 6.3 compiler. Signed-off-by: Marcin Juszkiewicz --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d7dee3ec1bf2..1708ad173c35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,12 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") FIND_PACKAGE(Threads) endif(CMAKE_SYSTEM_NAME MATCHES "Linux") +if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7) + message(FATAL_ERROR "GCC 7+ required due to C++17 requirements") + endif() +endif() + option(WITH_CCACHE "Build with ccache.") if(WITH_CCACHE) find_program(CCACHE_FOUND ccache)