ctest_build: Use "cmake --build" to launch the native build tool
This avoids requiring cmGlobalGenerator::GenerateBuildCommand to produce a string so that it can be later refactored to produce a vector with no quoting or escaping. It also makes the ctest_build command match what "ctest -T Build" would run in a build tree configured with the new build_command() command behavior. It also ensures that the native build tool used matches that selected by the configuration of the tree to be built.
This commit is contained in:
parent
bca67c710f
commit
2d072069e2
|
@ -114,9 +114,6 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
||||||
this->Makefile->GetCMakeInstance()->CreateGlobalGenerator(
|
this->Makefile->GetCMakeInstance()->CreateGlobalGenerator(
|
||||||
cmakeGeneratorName);
|
cmakeGeneratorName);
|
||||||
}
|
}
|
||||||
this->GlobalGenerator->FindMakeProgram(this->Makefile);
|
|
||||||
const char* cmakeMakeProgram
|
|
||||||
= this->Makefile->GetDefinition("CMAKE_MAKE_PROGRAM");
|
|
||||||
if(strlen(cmakeBuildConfiguration) == 0)
|
if(strlen(cmakeBuildConfiguration) == 0)
|
||||||
{
|
{
|
||||||
const char* config = 0;
|
const char* config = 0;
|
||||||
|
@ -133,10 +130,8 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
||||||
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
|
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
|
||||||
std::string buildCommand
|
std::string buildCommand
|
||||||
= this->GlobalGenerator->
|
= this->GlobalGenerator->
|
||||||
GenerateBuildCommand(cmakeMakeProgram,
|
GenerateCMakeBuildCommand(cmakeBuildTarget, cmakeBuildConfiguration,
|
||||||
cmakeProjectName, dir.c_str(),
|
cmakeBuildAdditionalFlags, true);
|
||||||
cmakeBuildAdditionalFlags, cmakeBuildTarget,
|
|
||||||
cmakeBuildConfiguration, true, false);
|
|
||||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||||
"SetMakeCommand:"
|
"SetMakeCommand:"
|
||||||
<< buildCommand.c_str() << "\n");
|
<< buildCommand.c_str() << "\n");
|
||||||
|
|
Loading…
Reference in New Issue