From ee3af68dd936b6a47eaa53c67d62ca13efcfb271 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 16 Oct 2018 13:18:08 +0200 Subject: [PATCH] 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 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7dee3ec1bf26..1708ad173c35d 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) -- 2.39.5