Skip to content

Commit

Permalink
Fix VS2015 crash when all installed SDKs are higher than 10.0.14393
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoshi committed Nov 27, 2018
1 parent 2d21004 commit 19d2f06
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/cmGlobalVisualStudio14Generator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
// only the UCRT MSIs were installed for them.
cmEraseIf(sdks, NoWindowsH());

// Skip SDKs that cannot be used with our toolset.
std::string maxVersion = this->GetWindows10SDKMaxVersion();
if (!maxVersion.empty()) {
cmEraseIf(sdks, WindowsSDKTooRecent(maxVersion));
}

if (!sdks.empty()) {
// Only use the filename, which will be the SDK version.
for (std::string& i : sdks) {
Expand All @@ -296,12 +302,6 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
// Sort the results to make sure we select the most recent one.
std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater);

// Skip SDKs that cannot be used with our toolset.
std::string maxVersion = this->GetWindows10SDKMaxVersion();
if (!maxVersion.empty()) {
cmEraseIf(sdks, WindowsSDKTooRecent(maxVersion));
}

// Look for a SDK exactly matching the requested target version.
for (std::string const& i : sdks) {
if (cmSystemTools::VersionCompareEqual(i, this->SystemVersion)) {
Expand Down

0 comments on commit 19d2f06

Please sign in to comment.