mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
VS: Select latest Windows SDK even when targeting Windows 8.1 and below
The policy added by commit f90c8ab54e (VS: Select latest available
Windows SDK version by default, 2023-04-03, v3.27.0-rc1~206^2~1) applied
only when targeting Windows 10+. Apply it to older versions too.
Fixes: #25170
Issue: #16202
This commit is contained in:
@@ -217,6 +217,16 @@ bool cmGlobalVisualStudio14Generator::InitializePlatformWindows(cmMakefile* mf)
|
||||
return this->SelectWindows10SDK(mf);
|
||||
}
|
||||
|
||||
// Under CMP0149 NEW behavior, we search for a Windows 10 SDK even
|
||||
// when targeting older Windows versions, but it is not required.
|
||||
if (mf->GetPolicyStatus(cmPolicies::CMP0149) == cmPolicies::NEW) {
|
||||
std::string const version = this->GetWindows10SDKVersion(mf);
|
||||
if (!version.empty()) {
|
||||
this->SetWindowsTargetPlatformVersion(version, mf);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// We are not targeting Windows 10+, so fall back to the Windows 8.1 SDK.
|
||||
// For VS 2019 and above we must explicitly specify it.
|
||||
if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS16 &&
|
||||
|
||||
Reference in New Issue
Block a user