summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-30 13:12:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-01-30 13:13:04 (GMT)
commitd685a46f56b6f7ccf5763b87611bf383e3aa8cb7 (patch)
tree766cace785bf9c58551a8c52e612618f50eef0bd
parentd36629661197b4255da2a1864ce7ec016b415d24 (diff)
parentda402a081b6575b4813e5e8798105317b451ac1e (diff)
downloadCMake-d685a46f56b6f7ccf5763b87611bf383e3aa8cb7.zip
CMake-d685a46f56b6f7ccf5763b87611bf383e3aa8cb7.tar.gz
CMake-d685a46f56b6f7ccf5763b87611bf383e3aa8cb7.tar.bz2
Merge topic 'vs-msbuild-arch'
da402a081b VS: Use MSBuild matching toolset host architecture 147d36ce93 Find native build tool after selecting a toolset Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2876
-rw-r--r--Source/cmGlobalGenerator.cxx10
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx12
2 files changed, 17 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 2b5c98f..386a3f7 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -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
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index bc6b453..12d9304 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -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;