From 3fb3f45a3586a3e320156dcf698df40ce8eb2922 Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Mon, 8 Feb 2016 16:51:59 +0100 Subject: [PATCH] MSVC: Disable non-conforming conversion from string literal to char* C++11 forbids conforming compilers from performing the deprecated conversion from a string literal to non-const char* or wchar_t*. Most compilers however still do it by default because not doing it breaks lots of legacy code. We don't have any of this legacy code anymore, so we can disable the conversion. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb4794f5b..d0db8741f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,9 @@ if(USE_GCC_STD_14) endif() if(MSVC) + # Disable non-standard conversion from string literal to (nonconst) char* + list(APPEND OC_CXX_FLAGS /Zc:strictStrings) + list(APPEND OC_CXX_FLAGS /MP) list(REMOVE_ITEM OC_CXX_FLAGS_DEBUG /Gm)