summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioVersionedGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-16 14:53:22 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-16 17:22:32 (GMT)
commitaabc3ca47d51731e247300e4a6159f41e9dcb17c (patch)
treedfbc626fa1439840d88dbefb92b59e47d4d97dc8 /Source/cmGlobalVisualStudioVersionedGenerator.cxx
parente66a7fe07b117362120ae62826eb51c189f39c40 (diff)
downloadCMake-aabc3ca47d51731e247300e4a6159f41e9dcb17c.zip
CMake-aabc3ca47d51731e247300e4a6159f41e9dcb17c.tar.gz
CMake-aabc3ca47d51731e247300e4a6159f41e9dcb17c.tar.bz2
cmGlobalVisualStudio10Generator: Adopt GetVSInstanceVersion method
Port from `cmGlobalVisualStudioVersionedGenerator`.
Diffstat (limited to 'Source/cmGlobalVisualStudioVersionedGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index c11ab1b..50dc30b 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -391,10 +391,15 @@ bool cmGlobalVisualStudioVersionedGenerator::GetVSInstance(
return vsSetupAPIHelper.GetVSInstanceInfo(dir);
}
-bool cmGlobalVisualStudioVersionedGenerator::GetVSInstanceVersion(
- unsigned long long& vsInstanceVersion) const
+cm::optional<unsigned long long>
+cmGlobalVisualStudioVersionedGenerator::GetVSInstanceVersion() const
{
- return vsSetupAPIHelper.GetVSInstanceVersion(vsInstanceVersion);
+ cm::optional<unsigned long long> result;
+ unsigned long long vsInstanceVersion;
+ if (vsSetupAPIHelper.GetVSInstanceVersion(vsInstanceVersion)) {
+ result = vsInstanceVersion;
+ }
+ return result;
}
bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
@@ -407,9 +412,9 @@ bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
return false;
}
unsigned long long const vsInstanceVersion16_7_P2 = 4503631666610212;
- unsigned long long vsInstanceVersion;
- return (this->GetVSInstanceVersion(vsInstanceVersion) &&
- vsInstanceVersion > vsInstanceVersion16_7_P2);
+ cm::optional<unsigned long long> vsInstanceVersion =
+ this->GetVSInstanceVersion();
+ return (vsInstanceVersion && *vsInstanceVersion > vsInstanceVersion16_7_P2);
}
const char*