diff options
Diffstat (limited to 'cmake/opentrack-platform.cmake')
-rw-r--r-- | cmake/opentrack-platform.cmake | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index 7e140e98..7882196e 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -25,7 +25,9 @@ if(NOT CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install") endif() -set(CMAKE_BUILD_TYPE_INIT "RELEASE") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE) +endif() if(APPLE) if(NOT CMAKE_OSX_ARCHITECTURES) @@ -60,9 +62,9 @@ if(MSVC) add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS) add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_ITERATOR_DEBUG_LEVEL=0) add_definitions(-D_HAS_EXCEPTIONS=0) - if(MSVC_VERSION GREATER 1910) # 1911 is 15.3 update - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -permissive-") - set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -permissive-") + 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") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zi -std:c++14") |