diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-02 06:49:46 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-02 07:54:23 +0200 |
commit | 334576cb4afc2ec76195a34849cc0c57d6afae5a (patch) | |
tree | d1bdd72dc9e8d5b0893d13650ddf5bc1dda28786 /cmake | |
parent | 1c14661160b217fe2b04097a9e47bdbe23431ace (diff) |
slowly start enabling c++17
Diffstat (limited to '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() |