From d35b6d468cecad217cce4284a84b10f33c919836 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 14 Jun 2018 13:46:21 -0400 Subject: [PATCH] Remove /std:c++11 flag MSVC doesn't actually support this Also actually indent the "if" block Ref #1301, dfhack/df-structures#247 --- CMakeLists.txt | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6163f718..237c254f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,26 +56,22 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) if(MSVC) - # cmake 3.10 is first version that support msvc standard settings - if(${CMAKE_VERSION} VERSION_LESS "3.10.0") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11") - endif() -# disable C4819 code-page warning -add_definitions( "/wd4819" ) - -# Disable use of POSIX name warnings -add_definitions ( "/D_CRT_NONSTDC_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS") - -# supress C4503 - VC++ dislikes if a name is too long. If you get -# weird and mysterious linking errors, you can disable this, but you'll have to -# deal with a LOT of compiler noise over it -# see https://msdn.microsoft.com/en-us/library/074af4b6.aspx -add_definitions( "/wd4503") - -# suppress C4267 - VC++ complains whenever we implicitly convert an integer to -# a smaller type, and most of the time this is just conversion from 64 to 32 bits -# for things like vector sizes, which are never that big anyway. -add_definitions( "/wd4267") + # disable C4819 code-page warning + add_definitions( "/wd4819" ) + + # Disable use of POSIX name warnings + add_definitions ( "/D_CRT_NONSTDC_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS") + + # supress C4503 - VC++ dislikes if a name is too long. If you get + # weird and mysterious linking errors, you can disable this, but you'll have to + # deal with a LOT of compiler noise over it + # see https://msdn.microsoft.com/en-us/library/074af4b6.aspx + add_definitions( "/wd4503") + + # suppress C4267 - VC++ complains whenever we implicitly convert an integer to + # a smaller type, and most of the time this is just conversion from 64 to 32 bits + # for things like vector sizes, which are never that big anyway. + add_definitions( "/wd4267") endif() # Automatically detect architecture based on Visual Studio generator