Skip to content

Commit ec7ae98

Browse files
committed
Build with c++2y for windows clang
1 parent 1611943 commit ec7ae98

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,16 @@ set(DISABLE_PCH CACHE BOOL "Disable precompiled headers as this may break certai
100100
set(BUILD_TESTING CACHE BOOL "Build unit tests")
101101

102102
# Build with C++ 17 on Linux for maximum compatibility with older system
103-
# but for Windows, enable C++ 26 to bypass a deprecation warning
103+
# but for Windows, enable C++ 20 to bypass a deprecation warning
104104
# (workaround for https://github.com/KhronosGroup/Vulkan-Hpp/issues/2034)
105105
# even though we do not yet use any C++ 20 features in our codebase
106-
# also catch2 now wants to build with c++26 on windows clang?
107106
if(WIN32)
108-
set(CMAKE_CXX_STANDARD 26)
107+
#clang wants c++2y for some catch2 stuff
108+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND BUILD_TESTING)
109+
add_compile_options(--std=c++2y)
110+
else()
111+
set(CMAKE_CXX_STANDARD 20)
112+
endif()
109113
else()
110114
set(CMAKE_CXX_STANDARD 17)
111115
endif()

0 commit comments

Comments
 (0)