VS: Add support for setting WindowsTargetPlatformVersion to 10.0

VS 2019 and above support this value to select a SDK version
automatically.

Fixes: #21403
This commit is contained in:
Brad King
2023-04-03 10:56:47 -04:00
parent 2f3d945f83
commit b512c53d43
3 changed files with 22 additions and 0 deletions
@@ -355,6 +355,16 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion(
cmMakefile* mf)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
// Accept specific version requests as-is.
if (this->GeneratorPlatformVersion) {
std::string const& ver = *this->GeneratorPlatformVersion;
// VS 2019 and above support specifying plain "10.0".
if (this->Version >= VSVersion::VS16 && ver == "10.0") {
return ver;
}
}
std::vector<std::string> win10Roots;
{