[PATCH] D118228: [CMake] Disable mvsc warning for new versions

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 01:42:45 PST 2022


sebastian-ne created this revision.
sebastian-ne added reviewers: Ericson2314, aaron.ballman.
Herald added subscribers: pengfei, mgorny.
sebastian-ne requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118228

Files:
  llvm/CMakeLists.txt


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -28,7 +28,7 @@
     "${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 "


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118228.403171.patch
Type: text/x-patch
Size: 720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220126/6fd36f5c/attachment.bin>


More information about the llvm-commits mailing list