summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-10-27 13:19:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-10-27 13:19:54 (GMT)
commit458b30ce40fa6465902478a5d9f4ba09e23195f6 (patch)
treeb1d1214f8800736e48ea3b7fe14684e30688e267
parente9456370782a33ec9a01bd036e82d025d1db439b (diff)
parent9eaf0932af0cd7881c712fbe4586ec59cb9e0d10 (diff)
downloadCMake-458b30ce40fa6465902478a5d9f4ba09e23195f6.zip
CMake-458b30ce40fa6465902478a5d9f4ba09e23195f6.tar.gz
CMake-458b30ce40fa6465902478a5d9f4ba09e23195f6.tar.bz2
Merge topic 'vs-instance-repeat'
9eaf0932af cmGlobalVisualStudioVersionedGenerator: Fix repeating SetGeneratorInstance Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6665
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx6
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index ec2e74f..f27b2c4 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -436,9 +436,11 @@ bool cmGlobalVisualStudioVersionedGenerator::MatchesGeneratorName(
bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance(
std::string const& i, cmMakefile* mf)
{
- if (this->GeneratorInstance && i == *(this->GeneratorInstance)) {
+ if (this->LastGeneratorInstanceString &&
+ i == *(this->LastGeneratorInstanceString)) {
return true;
}
+
if (!i.empty()) {
if (!this->vsSetupAPIHelper.SetVSInstance(i)) {
std::ostringstream e;
@@ -478,6 +480,8 @@ bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance(
// The selected instance may have a different MSBuild than previously found.
this->MSBuildCommandInitialized = false;
+ this->LastGeneratorInstanceString = i;
+
return true;
}
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h
index b7760ac..2aed65b 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.h
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.h
@@ -76,5 +76,5 @@ private:
class Factory17;
friend class Factory17;
mutable cmVSSetupAPIHelper vsSetupAPIHelper;
- cm::optional<std::string> GeneratorInstance;
+ cm::optional<std::string> LastGeneratorInstanceString;
};