Skip to content

Commit 7e309f3

Browse files
authored
Merge pull request #47594 from tchaikov/wip-cmake-win32
cmake: enforce gcc-10 for win32 port Reviewed-by: Casey Bodley <cbodley@redhat.com>
2 parents e856368 + 6cdec0c commit 7e309f3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,15 @@ if(COMPILER_SUPPORTS_REDUNDANT_MOVE)
115115
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wredundant-move>)
116116
endif()
117117
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
118-
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11) # require >= gcc-11
119-
message(FATAL_ERROR "C++20 support requires a minimum GCC version of 11.")
118+
if(WIN32)
119+
# require >= gcc-10 for compiling the windows port
120+
set(minimum_gcc_version 10)
121+
else()
122+
# require >= gcc-11 for compiling the whole tree
123+
set(minimum_gcc_version 11)
124+
endif()
125+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS minimum_gcc_version)
126+
message(FATAL_ERROR "C++20 support requires a minimum GCC version of ${minimum_gcc_version}.")
120127
endif()
121128
if(MINGW)
122129
# The MINGW headers are missing some "const" qualifiers.

0 commit comments

Comments
 (0)