From ef35789909da139d77a4fd7b6fbbb9eadad10d93 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 10 Apr 2020 19:02:01 -1000 Subject: [PATCH] Exclude CMake CXX standard from MSVC --- CMakeLists.txt | 6 ++++-- test/CMakeLists.txt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 352e5f0..255f513 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17 project(zeus) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +if (NOT MSVC) + set(CMAKE_CXX_STANDARD 20) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() set(SOURCES src/CVector3f.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9409c7f..bb5f8af 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17 project(zeustest) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +if (NOT MSVC) + set(CMAKE_CXX_STANDARD 20) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() add_executable(zeustest main.cpp) target_link_libraries(zeustest zeus)