Skip to content

Commit

Permalink
Merge pull request #42 from Rhidian12/cmake-support-for-older-compiler
Browse files Browse the repository at this point in the history
CMake support for older visual studio compilers
  • Loading branch information
LeeVangraefschepe authored Feb 21, 2024
2 parents 9a1fceb + 6684aa6 commit 8cb8e4f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
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)
else()
set(CMAKE_CXX_STANDARD 20)
endif()
else()
set(CMAKE_CXX_STANDARD 20)
endif()

set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (MSVC)
Expand Down

0 comments on commit 8cb8e4f

Please sign in to comment.