Skip to content

Commit b8ae32b

Browse files
Merge pull request #180 from microsoft/dev/gcampbell/Update
Update compatibility
2 parents c7fa398 + d207209 commit b8ae32b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Source/cmGlobalVisualStudioVersionedGenerator.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,10 @@ bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance(
505505
}
506506

507507
if (!this->GeneratorInstanceVersion.empty()) {
508-
std::string const majorStr = VSVersionToMajorString(this->Version);
508+
std::string majorStr = VSVersionToMajorString(this->Version);
509+
if (majorStr == "17" && this->GeneratorInstanceVersion._Starts_with("18")) {
510+
majorStr = "18";
511+
}
509512
cmsys::RegularExpression versionRegex(
510513
cmStrCat('^', majorStr, R"(\.[0-9]+\.[0-9]+\.[0-9]+$)"));
511514
if (!versionRegex.find(this->GeneratorInstanceVersion)) {

Source/cmVSSetupHelper.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
459459
for (const auto& instanceInfo : vecVSInstancesAll) {
460460
// We are looking for a specific major version.
461461
if (instanceInfo.Version.size() < wantVersion.size() ||
462-
instanceInfo.Version.substr(0, wantVersion.size()) != wantVersion) {
462+
(instanceInfo.Version.substr(0, wantVersion.size()) != wantVersion &&
463+
!(instanceInfo.Version.substr(0, wantVersion.size()) == "18." && wantVersion == "17."))) {
463464
continue;
464465
}
465466

0 commit comments

Comments
 (0)