mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 11:18:40 +08:00
cmGlobalVisualStudioVersionedGenerator: Allow repeating SetGeneratorInstance
This commit is contained in:
@@ -436,6 +436,9 @@ bool cmGlobalVisualStudioVersionedGenerator::MatchesGeneratorName(
|
|||||||
bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance(
|
bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance(
|
||||||
std::string const& i, cmMakefile* mf)
|
std::string const& i, cmMakefile* mf)
|
||||||
{
|
{
|
||||||
|
if (this->GeneratorInstance && i == *(this->GeneratorInstance)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (!i.empty()) {
|
if (!i.empty()) {
|
||||||
if (!this->vsSetupAPIHelper.SetVSInstance(i)) {
|
if (!this->vsSetupAPIHelper.SetVSInstance(i)) {
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
@@ -472,6 +475,9 @@ bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance(
|
|||||||
cmStateEnums::INTERNAL);
|
cmStateEnums::INTERNAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The selected instance may have a different MSBuild than previously found.
|
||||||
|
this->MSBuildCommandInitialized = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include <cm/optional>
|
||||||
|
|
||||||
#include "cmGlobalVisualStudio14Generator.h"
|
#include "cmGlobalVisualStudio14Generator.h"
|
||||||
#include "cmVSSetupHelper.h"
|
#include "cmVSSetupHelper.h"
|
||||||
|
|
||||||
@@ -72,4 +74,5 @@ private:
|
|||||||
class Factory17;
|
class Factory17;
|
||||||
friend class Factory17;
|
friend class Factory17;
|
||||||
mutable cmVSSetupAPIHelper vsSetupAPIHelper;
|
mutable cmVSSetupAPIHelper vsSetupAPIHelper;
|
||||||
|
cm::optional<std::string> GeneratorInstance;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user