[llvm] ecf7a0e - [CMake] Disable mvsc warning for new versions

Sebastian Neubauer via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 06:08:19 PST 2022


Author: Sebastian Neubauer
Date: 2022-01-26T15:07:35+01:00
New Revision: ecf7a0e33883fc8f001445c68a1128866cb81d38

URL: https://github.com/llvm/llvm-project/commit/ecf7a0e33883fc8f001445c68a1128866cb81d38
DIFF: https://github.com/llvm/llvm-project/commit/ecf7a0e33883fc8f001445c68a1128866cb81d38.diff

LOG: [CMake] Disable mvsc warning for new versions

Starting with VS 2019, CMake defaults to the x64 host toolchain, so the
warning does not apply anymore.

References:
VS 2017 defaults to x86
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html?highlight=host#toolset-selection
VS 2019 and 2022 default to x64 for x64 targets
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html?highlight=host#toolset-selection
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html?highlight=host#toolset-selection

Differential Revision: https://reviews.llvm.org/D118228

Added: 
    

Modified: 
    llvm/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 76c918306b22..a5245c22040e 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -28,7 +28,7 @@ if (NOT PACKAGE_VERSION)
     "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}")
 endif()
 
-if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_GENERATOR_TOOLSET STREQUAL ""))
+if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (MSVC_TOOLSET_VERSION LESS 142) AND (CMAKE_GENERATOR_TOOLSET STREQUAL ""))
   message(WARNING "Visual Studio generators use the x86 host compiler by "
                   "default, even for 64-bit targets. This can result in linker "
                   "instability and out of memory errors. To use the 64-bit "


        


More information about the llvm-commits mailing list