mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 07:11:05 -06:00
cmGlobalVisualStudioVersionedGenerator: Fix repeating SetGeneratorInstance
Fix logic added by commit 8917b8512f
(cmGlobalVisualStudioVersionedGenerator: Allow repeating
SetGeneratorInstance, 2021-10-20) to avoid repeating work.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,5 +76,5 @@ private:
|
||||
class Factory17;
|
||||
friend class Factory17;
|
||||
mutable cmVSSetupAPIHelper vsSetupAPIHelper;
|
||||
cm::optional<std::string> GeneratorInstance;
|
||||
cm::optional<std::string> LastGeneratorInstanceString;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user