mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
Merge topic 'vs-msbuild-arch'
da402a081bVS: Use MSBuild matching toolset host architecture147d36ce93Find native build tool after selecting a toolset Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2876
This commit is contained in:
@@ -567,11 +567,6 @@ void cmGlobalGenerator::EnableLanguage(
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the native build tool for this generator.
|
||||
if (!this->FindMakeProgram(mf)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Tell the generator about the target system.
|
||||
std::string system = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
|
||||
if (!this->SetSystemName(system, mf)) {
|
||||
@@ -592,6 +587,11 @@ void cmGlobalGenerator::EnableLanguage(
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the native build tool for this generator.
|
||||
if (!this->FindMakeProgram(mf)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the languages are supported by the generator and its
|
||||
|
||||
@@ -471,6 +471,18 @@ std::string cmGlobalVisualStudioVersionedGenerator::FindMSBuildCommand()
|
||||
// Ask Visual Studio Installer tool.
|
||||
std::string vs;
|
||||
if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
|
||||
std::string const& hostArch =
|
||||
this->GetPlatformToolsetHostArchitectureString();
|
||||
if (hostArch == "x64") {
|
||||
msbuild = vs + "/MSBuild/Current/Bin/amd64/MSBuild.exe";
|
||||
if (cmSystemTools::FileExists(msbuild)) {
|
||||
return msbuild;
|
||||
}
|
||||
msbuild = vs + "/MSBuild/15.0/Bin/amd64/MSBuild.exe";
|
||||
if (cmSystemTools::FileExists(msbuild)) {
|
||||
return msbuild;
|
||||
}
|
||||
}
|
||||
msbuild = vs + "/MSBuild/Current/Bin/MSBuild.exe";
|
||||
if (cmSystemTools::FileExists(msbuild)) {
|
||||
return msbuild;
|
||||
|
||||
Reference in New Issue
Block a user