Skip to content

Commit

Permalink
Merge pull request #69 from Microsoft/dev/jgoshi/vs2015GeneratorCrash
Browse files Browse the repository at this point in the history
Fix VS2015 crash when all installed SDKs are higher than 10.0.14393
  • Loading branch information
jgoshi committed Nov 27, 2018
2 parents 2d21004 + 19d2f06 commit 6c4f04a
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 6c4f04a

Please sign in to comment.