From: Kefu Chai Date: Mon, 15 Aug 2022 07:24:14 +0000 (+0800) Subject: cmake: enforce gcc-10 for win32 port X-Git-Tag: v18.0.0~259^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6cdec0cdfe759fe3474ab324e6095714fd9f71d9;p=ceph.git cmake: enforce gcc-10 for win32 port 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 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f22ff7b2b9f..bf89a3aea78 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -115,8 +115,15 @@ if(COMPILER_SUPPORTS_REDUNDANT_MOVE) add_compile_options($<$:-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.