[PATCH] D53073: With CMake 3.8+ force Visual Studio generator builds to use the x64 host toolchain if the user is on a 64-bit system

Greg Bedwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 10 05:19:56 PDT 2018


gbedwell added a comment.

I find the CMake documentation very unclear here.  On the related page for https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_TOOLSET.html it says:

  The value of this variable should never be modified by project code. A toolchain file specified by the CMAKE_TOOLCHAIN_FILE variable may initialize CMAKE_GENERATOR_TOOLSET. Once a given build tree has been initialized with a particular value for this variable, changing the value has undefined behavior.

However, as this is within the existing check that CMAKE_GENERATOR_TOOLSET is empty, and it happens prior to the project command where the tree actually appears to be initialized, (and that in my testing this does precisely what I'd want it to) I'm pretty convinced that this change is safe and correct.


https://reviews.llvm.org/D53073





More information about the llvm-commits mailing list