From 72d10dd8ffffc3c0898bd31526a173988e40f3cf Mon Sep 17 00:00:00 2001 From: Rhidian De Wit <74491212+Rhidian12@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:21:31 +0100 Subject: [PATCH 1/2] update cmake --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24ab508..77a3a66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,16 @@ cmake_minimum_required(VERSION 3.22) Project(Leap VERSION 1.0.0) -set(CMAKE_CXX_STANDARD 20) + +if (MSVC) + # 19.31.31105.0 is the compiler version of VS 2022 17.1.3, hard to tell which version introduced C++23 + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL "19.31.31105.0") + set(CMAKE_CXX_STANDARD 23) + endif() +else() + set(CMAKE_CXX_STANDARD 20) +endif() + set(CMAKE_CXX_STANDARD_REQUIRED ON) if (MSVC) From 6684aa69cf6ce49492a44845c3dab7d569ff45ad Mon Sep 17 00:00:00 2001 From: Rhidian De Wit <74491212+Rhidian12@users.noreply.github.com> Date: Tue, 20 Feb 2024 22:26:25 +0100 Subject: [PATCH 2/2] fix cmake --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77a3a66..23661d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,8 @@ if (MSVC) # 19.31.31105.0 is the compiler version of VS 2022 17.1.3, hard to tell which version introduced C++23 if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL "19.31.31105.0") set(CMAKE_CXX_STANDARD 23) + else() + set(CMAKE_CXX_STANDARD 20) endif() else() set(CMAKE_CXX_STANDARD 20)