Optimise TVar <: union of that TVar simplification
[hiphop-php.git] / CMake / VisualStudioToolset.cmake
blob1eab533c7e7f43803b5828c3de243ff8ff93e1a2
1 # Due to HHVM's size, we need to use the native 64-bit toolchain to get a decent link time,
2 # and, in fact, it's also needed to be able to link at all in debug mode, due to the size of
3 # the hphp_runtime_static static library. However, Visual Studio defaults to using the 32-bit
4 # hosted cross compiler targetting 64-bit. Unfortunately, CMake doesn't provide us a way to
5 # do this, so we have to resort to a hack-around in order to make this possible. Because the
6 # toolset value is put into the project file unescaped, we can use it to add the PreferredToolArchitecture
7 # value that we need, as long as we make sure to properly close and re-open the current tags.
9 # To add support for newer MSVC versions, simply adjust the actual toolset value at the start
10 # and end of the string.
12 # Unfortunately, we can't rely on the MSVC and MSVC14 variables to check if we need to enable
13 # this, due to the fact they are set when the C/CXX languages are enabled, however, this value
14 # needs to be set before the languages are enabled in order to have any effect, so we set it
15 # based directly off of the name of the generator, which is set before configuration even begins.
17 if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 15( 2017)? Win64")
18     set(CMAKE_GENERATOR_TOOLSET "v141</PlatformToolset><PreferredToolArchitecture>x64</PreferredToolArchitecture><PlatformToolset>v141")
19 endif()