mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 02:59:22 -05:00
Merge topic 'vs-msbuild-platform'
98e4fbdc06VS: Pass platform when invoking MSBuild6597428c36ctest: Fix generator platform under --build-nocmaked8294fefe8cmake: Fix generator platform under --build mode Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2413
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include "cmCTest.h"
|
#include "cmCTest.h"
|
||||||
#include "cmCTestTestHandler.h"
|
#include "cmCTestTestHandler.h"
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
|
#include "cmMakefile.h"
|
||||||
#include "cmSystemTools.h"
|
#include "cmSystemTools.h"
|
||||||
#include "cmWorkingDirectory.h"
|
#include "cmWorkingDirectory.h"
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
@@ -210,9 +211,14 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
|
|||||||
|
|
||||||
if (this->BuildNoCMake) {
|
if (this->BuildNoCMake) {
|
||||||
// Make the generator available for the Build call below.
|
// Make the generator available for the Build call below.
|
||||||
cm.SetGlobalGenerator(cm.CreateGlobalGenerator(this->BuildGenerator));
|
cmGlobalGenerator* gen = cm.CreateGlobalGenerator(this->BuildGenerator);
|
||||||
cm.SetGeneratorPlatform(this->BuildGeneratorPlatform);
|
cm.SetGlobalGenerator(gen);
|
||||||
cm.SetGeneratorToolset(this->BuildGeneratorToolset);
|
if (!this->BuildGeneratorPlatform.empty()) {
|
||||||
|
cmMakefile mf(gen, cm.GetCurrentSnapshot());
|
||||||
|
if (!gen->SetGeneratorPlatform(this->BuildGeneratorPlatform, &mf)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Load the cache to make CMAKE_MAKE_PROGRAM available.
|
// Load the cache to make CMAKE_MAKE_PROGRAM available.
|
||||||
cm.LoadCache(this->BinaryDir);
|
cm.LoadCache(this->BinaryDir);
|
||||||
|
|||||||
@@ -938,6 +938,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
|
|||||||
configArg += "Debug";
|
configArg += "Debug";
|
||||||
}
|
}
|
||||||
makeCommand.push_back(configArg);
|
makeCommand.push_back(configArg);
|
||||||
|
makeCommand.push_back("/p:Platform=" + this->GetPlatformName());
|
||||||
makeCommand.push_back(std::string("/p:VisualStudioVersion=") +
|
makeCommand.push_back(std::string("/p:VisualStudioVersion=") +
|
||||||
this->GetIDEVersion());
|
this->GetIDEVersion());
|
||||||
|
|
||||||
|
|||||||
@@ -2467,6 +2467,14 @@ int cmake::Build(int jobs, const std::string& dir, const std::string& target,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const char* cachedGeneratorPlatform =
|
||||||
|
this->State->GetCacheEntryValue("CMAKE_GENERATOR_PLATFORM");
|
||||||
|
if (cachedGeneratorPlatform) {
|
||||||
|
cmMakefile mf(gen, this->GetCurrentSnapshot());
|
||||||
|
if (!gen->SetGeneratorPlatform(cachedGeneratorPlatform, &mf)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
std::string output;
|
std::string output;
|
||||||
std::string projName;
|
std::string projName;
|
||||||
const char* cachedProjectName =
|
const char* cachedProjectName =
|
||||||
|
|||||||
Reference in New Issue
Block a user