Commit fec6b413 authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Switch to a minumim version constraint for the MSVC version checks

Summary:
Just require that MSVC is at least MSVC 2017

Closes: https://github.com/facebook/folly/issues/949

Reviewed By: yfeldblum

Differential Revision: D10355264

fbshipit-source-id: 52ac7489200285f06c5f4fb3d176f6427974b163
parent 5348a349
...@@ -89,10 +89,9 @@ function(apply_folly_compile_options_to_target THETARGET) ...@@ -89,10 +89,9 @@ function(apply_folly_compile_options_to_target THETARGET)
/Zc:threadSafeInit # Enable thread-safe function-local statics initialization. /Zc:threadSafeInit # Enable thread-safe function-local statics initialization.
/Zc:throwingNew # Assume operator new throws on failure. /Zc:throwingNew # Assume operator new throws on failure.
/permissive- # Be mean, don't allow bad non-standard stuff (C++/CLI, __declspec, etc. are all left intact).
/std:${MSVC_LANGUAGE_VERSION} # Build in the requested version of C++ /std:${MSVC_LANGUAGE_VERSION} # Build in the requested version of C++
# This is only supported by MSVC 2017
$<$<BOOL:${MSVC_IS_2017}>:/permissive-> # Be mean, don't allow bad non-standard stuff (C++/CLI, __declspec, etc. are all left intact).
PRIVATE PRIVATE
/bigobj # Support objects with > 65k sections. Needed due to templates. /bigobj # Support objects with > 65k sections. Needed due to templates.
/favor:${MSVC_FAVORED_ARCHITECTURE} # Architecture to prefer when generating code. /favor:${MSVC_FAVORED_ARCHITECTURE} # Architecture to prefer when generating code.
...@@ -188,13 +187,6 @@ function(apply_folly_compile_options_to_target THETARGET) ...@@ -188,13 +187,6 @@ function(apply_folly_compile_options_to_target THETARGET)
/wd4701 # Potentially uninitialized local variable used. /wd4701 # Potentially uninitialized local variable used.
/wd4702 # Unreachable code. /wd4702 # Unreachable code.
# MSVC 2015 only:
$<$<BOOL:${MSVC_IS_2015}>:
/wd4268 # Static/global data initialized with compiler generated default constructor fills the object with zeros.
/wd4510 # Default constructor was implicitly defined as deleted.
/wd4814 # In C++14 'constexpr' will not imply 'const'.
>
# These warnings are disabled because we've # These warnings are disabled because we've
# enabled all warnings. If all warnings are # enabled all warnings. If all warnings are
# not enabled, we still need to disable them # not enabled, we still need to disable them
......
...@@ -49,17 +49,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") ...@@ -49,17 +49,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
message(FATAL_ERROR "Folly requires a 64bit target architecture.") message(FATAL_ERROR "Folly requires a 64bit target architecture.")
endif() endif()
if (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920) if (MSVC_VERSION LESS 1900)
set(MSVC_IS_2015 OFF)
set(MSVC_IS_2017 ON)
elseif (MSVC_VERSION EQUAL 1900)
set(MSVC_IS_2015 ON)
set(MSVC_IS_2017 OFF)
else()
message( message(
FATAL_ERROR FATAL_ERROR
"This build script only supports building Folly on 64-bit Windows with " "This build script only supports building Folly on 64-bit Windows with "
"Visual Studio 2015 or Visual Studio 2017. " "at least Visual Studio 2017. "
"MSVC version '${MSVC_VERSION}' is not supported." "MSVC version '${MSVC_VERSION}' is not supported."
) )
endif() endif()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment