diff options
Diffstat (limited to 'cmake/opentrack-platform.cmake')
-rw-r--r-- | cmake/opentrack-platform.cmake | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index 7e627e64..b977c5d8 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -62,13 +62,23 @@ if(MSVC) add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_NO_DEBUG_HEAP) add_definitions(-D_ITERATOR_DEBUG_LEVEL=0) add_definitions(-D_HAS_EXCEPTIONS=0) - if(MSVC_VERSION GREATER 1909) # visual studio 2017 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -permissive- -diagnostics:caret") - set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -permissive- -diagnostics:caret") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zi") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Zi") + + if(NOT CMAKE_COMPILER_IS_CLANG) + if(MSVC_VERSION GREATER 1909) # visual studio 2017 + set(__stuff "-permissive- -diagnostics:caret -Qvec-report:1") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${__stuff}") + set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${__stuff}") + endif() + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std:c++latest") + else() + set(__stuff "-fms-compatibility -fms-compatibility-version=1911 -fms-extensions") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${__stuff} -std:c++latest -Xclang -std=c++17") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${__stuff}") endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zi -std:c++14") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Zi") if(opentrack-64bit) set(ent "-HIGHENTROPYVA") else() @@ -116,8 +126,8 @@ if(APPLE) endif() if(NOT MSVC) - set(CMAKE_CXX_STANDARD 14) - set(CMAKE_CXX_STANDARD_DEFAULT 14) + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_DEFAULT 17) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_EXTENSIONS FALSE) endif() |