MarkSchofield / WindowsToolchain

A repository containing a CMake toolchain for using MSVC
MIT License
106 stars 19 forks source link

Avoid setting MSVC_VERSION in the toolchain, rely on CMake setting it (and others) #91

Closed MarkSchofield closed 10 months ago

MarkSchofield commented 10 months ago

90 identified that the MSVC_TOOLSET_VERSION isn't set when using the Windows.EWDK.toolchain.cmake. It turns out that it's not set when using the Windows.MSVC.toolchain.cmake either.

The toolchain files do set MSVC_VERSION, and that's the problem. By setting MSVC_VERSION, we end-up bypassing CMake's code to automatically set MSVC_TOOLSET_VERSION (and other variables) for us in CMake/Modules/Platform/Windows-MSVC.cmake. Removing the toolchain's code to calculate MSVC_VERSION seems like the right thing to do:

  1. It's less code in the Toolchain files.
  2. It's one fewer processes created during configuration.
  3. The CMake logic sets all of the right variables.