Skip to content

Commit

Permalink
Limit the version range for the VS generator to versions that CMake c…
Browse files Browse the repository at this point in the history
…urrently understands. (#7342)
  • Loading branch information
jkoritzinsky authored May 6, 2021
1 parent 08e48f6 commit 3094203
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@
<PropertyGroup>
<_CMakeMultiConfigurationGenerator>true</_CMakeMultiConfigurationGenerator>
<_CMakePassArchitectureToGenerator>true</_CMakePassArchitectureToGenerator>
<!-- We limit the VS version range for the generator since CMake only knows about specific VS versions -->
<VSGeneratorVersionRange Condition="'$(VSGeneratorVersionRange)' == ''">[,17.0)</VSGeneratorVersionRange>
<!-- Visual Studio uses the Win32 name for the x86 target architecture. -->
<Platform Condition="'$(Platform)' == 'x86'">Win32</Platform>
</PropertyGroup>

<Error Condition="'$(_VSNativeCompilerComponentArchName)' == ''" Text="Unable to determine if Visual Studio has MSVC tools installed for the '$(Platform)' architecture." />

<Exec
Command="$(VSWherePath) -latest -prerelease -products * -requires $(_VSNativeCompilerComponentName) -property installationVersion"
Command="$(VSWherePath) -latest -prerelease -products * -version $(VSGeneratorVersionRange) -requires $(_VSNativeCompilerComponentName) -property installationVersion"
EchoOff="true"
ConsoleToMsBuild="true"
StandardOutputImportance="Low">
Expand Down

0 comments on commit 3094203

Please sign in to comment.