summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioVersionedGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-17 11:30:48 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-17 11:54:48 (GMT)
commit3fd65f5ca601d38c7b2ee8c99b148df31cea1acd (patch)
treee36f7bd076f484ca5148a383fbaf4aeec8d2d673 /Source/cmGlobalVisualStudioVersionedGenerator.cxx
parentc92595be1d7c0ae3cd4ea8ff0ce27ede37f676e8 (diff)
downloadCMake-3fd65f5ca601d38c7b2ee8c99b148df31cea1acd.zip
CMake-3fd65f5ca601d38c7b2ee8c99b148df31cea1acd.tar.gz
CMake-3fd65f5ca601d38c7b2ee8c99b148df31cea1acd.tar.bz2
VS: Compare VS instance versions as strings
This makes the values more readable.
Diffstat (limited to 'Source/cmGlobalVisualStudioVersionedGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 50dc30b..384aa66 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -391,11 +391,11 @@ bool cmGlobalVisualStudioVersionedGenerator::GetVSInstance(
return vsSetupAPIHelper.GetVSInstanceInfo(dir);
}
-cm::optional<unsigned long long>
+cm::optional<std::string>
cmGlobalVisualStudioVersionedGenerator::GetVSInstanceVersion() const
{
- cm::optional<unsigned long long> result;
- unsigned long long vsInstanceVersion;
+ cm::optional<std::string> result;
+ std::string vsInstanceVersion;
if (vsSetupAPIHelper.GetVSInstanceVersion(vsInstanceVersion)) {
result = vsInstanceVersion;
}
@@ -411,10 +411,10 @@ bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
if (this->Version < cmGlobalVisualStudioGenerator::VSVersion::VS16) {
return false;
}
- unsigned long long const vsInstanceVersion16_7_P2 = 4503631666610212;
- cm::optional<unsigned long long> vsInstanceVersion =
- this->GetVSInstanceVersion();
- return (vsInstanceVersion && *vsInstanceVersion > vsInstanceVersion16_7_P2);
+ static std::string const vsVer16_7_P2 = "16.7.30128.36";
+ cm::optional<std::string> vsVer = this->GetVSInstanceVersion();
+ return (vsVer &&
+ cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer16_7_P2));
}
const char*