]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: enforce gcc-10 for win32 port 47594/head
authorKefu Chai <tchaikov@gmail.com>
Mon, 15 Aug 2022 07:24:14 +0000 (15:24 +0800)
committerKefu Chai <tchaikov@gmail.com>
Mon, 15 Aug 2022 07:24:15 +0000 (15:24 +0800)
we only have GCC-10 targeting MinGW at the time of writing, and it
is good enough for compiling the Winows port.

so let's relax the requirement to enable the windows build.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/CMakeLists.txt

index f22ff7b2b9feaf2fd5329c43fa9c5a20724e5edf..bf89a3aea78d86594ab8b7a28e5c80c9e3bbb4f0 100644 (file)
@@ -115,8 +115,15 @@ if(COMPILER_SUPPORTS_REDUNDANT_MOVE)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wredundant-move>)
 endif()
 if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11) # require >= gcc-11
-    message(FATAL_ERROR "C++20 support requires a minimum GCC version of 11.")
+  if(WIN32)
+    # require >= gcc-10 for compiling the windows port
+    set(minimum_gcc_version 10)
+  else()
+    # require >= gcc-11 for compiling the whole tree
+    set(minimum_gcc_version 11)
+  endif()
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS minimum_gcc_version)
+    message(FATAL_ERROR "C++20 support requires a minimum GCC version of ${minimum_gcc_version}.")
   endif()
   if(MINGW)
     # The MINGW headers are missing some "const" qualifiers.