]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: mark gcc 7 as minimum C++ compiler (due to std++17) 24615/head
authorMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Tue, 16 Oct 2018 11:18:08 +0000 (13:18 +0200)
committerMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Tue, 16 Oct 2018 14:34:03 +0000 (16:34 +0200)
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 <marcin.juszkiewicz@linaro.org>
CMakeLists.txt

index d7dee3ec1bf267da0de4653da974a9cf4269fe14..1708ad173c35dcb390a395e9864aef9ed5f29dd2 100644 (file)
@@ -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)