mirror of
https://github.com/yaobinwen/CMake.git
synced 2026-01-28 14:03:25 +00:00
cmGlobalVisualStudio10Generator: Add method to find MSBuild early
Add a way to find MSBuild before the main `FindMakeProgram` code path has executed.
This commit is contained in:
@ -856,6 +856,12 @@ std::string const& cmGlobalVisualStudio10Generator::GetMSBuildCommand()
|
||||
return this->MSBuildCommand;
|
||||
}
|
||||
|
||||
cm::optional<std::string>
|
||||
cmGlobalVisualStudio10Generator::FindMSBuildCommandEarly(cmMakefile*)
|
||||
{
|
||||
return this->GetMSBuildCommand();
|
||||
}
|
||||
|
||||
std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand()
|
||||
{
|
||||
std::string msbuild;
|
||||
|
||||
@ -134,6 +134,8 @@ public:
|
||||
|
||||
bool GetSupportsUnityBuilds() const { return this->SupportsUnityBuilds; }
|
||||
|
||||
virtual cm::optional<std::string> FindMSBuildCommandEarly(cmMakefile* mf);
|
||||
|
||||
bool FindMakeProgram(cmMakefile* mf) override;
|
||||
|
||||
bool IsIPOSupported() const override { return true; }
|
||||
|
||||
@ -718,6 +718,17 @@ cmGlobalVisualStudioVersionedGenerator::GetWindows10SDKMaxVersionDefault(
|
||||
return std::string();
|
||||
}
|
||||
|
||||
cm::optional<std::string>
|
||||
cmGlobalVisualStudioVersionedGenerator::FindMSBuildCommandEarly(cmMakefile* mf)
|
||||
{
|
||||
std::string instance = mf->GetSafeDefinition("CMAKE_GENERATOR_INSTANCE");
|
||||
if (!this->SetGeneratorInstance(instance, mf)) {
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
return {};
|
||||
}
|
||||
return this->cmGlobalVisualStudio14Generator::FindMSBuildCommandEarly(mf);
|
||||
}
|
||||
|
||||
std::string cmGlobalVisualStudioVersionedGenerator::FindMSBuildCommand()
|
||||
{
|
||||
std::string msbuild;
|
||||
|
||||
@ -31,6 +31,8 @@ public:
|
||||
|
||||
bool GetVSInstance(std::string& dir) const;
|
||||
|
||||
cm::optional<std::string> FindMSBuildCommandEarly(cmMakefile* mf) override;
|
||||
|
||||
cm::optional<std::string> GetVSInstanceVersion() const override;
|
||||
|
||||
AuxToolset FindAuxToolset(std::string& version,
|
||||
|
||||
Reference in New Issue
Block a user