diff options
author | Brad King <brad.king@kitware.com> | 2021-06-16 14:53:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-16 17:22:32 (GMT) |
commit | aabc3ca47d51731e247300e4a6159f41e9dcb17c (patch) | |
tree | dfbc626fa1439840d88dbefb92b59e47d4d97dc8 /Source/cmGlobalVisualStudioVersionedGenerator.cxx | |
parent | e66a7fe07b117362120ae62826eb51c189f39c40 (diff) | |
download | CMake-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.cxx | 17 |
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* |