BUG: cmGlobalGenerator::Build should not always use the /fast target name because dependency checking is often required. It now takes an argument specifying whether to use the /fast target name, and the argument is currently only true for try-compiles.
This commit is contained in:
parent
bfb0ec58e8
commit
87d4d0e039
@ -346,7 +346,7 @@ int cmCPackGenericGenerator::InstallProject()
|
|||||||
= globalGenerator->GenerateBuildCommand(cmakeMakeProgram,
|
= globalGenerator->GenerateBuildCommand(cmakeMakeProgram,
|
||||||
installProjectName.c_str(), 0,
|
installProjectName.c_str(), 0,
|
||||||
globalGenerator->GetPreinstallTargetName(),
|
globalGenerator->GetPreinstallTargetName(),
|
||||||
buildConfig, false);
|
buildConfig, false, false);
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||||
"- Install command: " << buildCommand << std::endl);
|
"- Install command: " << buildCommand << std::endl);
|
||||||
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
||||||
|
@ -196,7 +196,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
|
|||||||
this->SourceDir.c_str(), this->BinaryDir.c_str(),
|
this->SourceDir.c_str(), this->BinaryDir.c_str(),
|
||||||
this->BuildProject.c_str(), tarIt->c_str(),
|
this->BuildProject.c_str(), tarIt->c_str(),
|
||||||
&output, this->BuildMakeProgram.c_str(),
|
&output, this->BuildMakeProgram.c_str(),
|
||||||
this->CTest->GetConfigType().c_str(),!this->BuildNoClean);
|
this->CTest->GetConfigType().c_str(),!this->BuildNoClean, false);
|
||||||
|
|
||||||
out << output;
|
out << output;
|
||||||
// if the build failed then return
|
// if the build failed then return
|
||||||
|
@ -93,7 +93,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
|||||||
std::string buildCommand
|
std::string buildCommand
|
||||||
= this->GlobalGenerator->GenerateBuildCommand(cmakeMakeProgram,
|
= this->GlobalGenerator->GenerateBuildCommand(cmakeMakeProgram,
|
||||||
cmakeProjectName,
|
cmakeProjectName,
|
||||||
cmakeBuildAdditionalFlags, 0, cmakeBuildConfiguration, true);
|
cmakeBuildAdditionalFlags, 0, cmakeBuildConfiguration, true, false);
|
||||||
this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str());
|
this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -34,7 +34,7 @@ bool cmBuildCommand::InitialPass(std::vector<std::string> const& args)
|
|||||||
std::string makecommand = this->Makefile->GetLocalGenerator()
|
std::string makecommand = this->Makefile->GetLocalGenerator()
|
||||||
->GetGlobalGenerator()->GenerateBuildCommand
|
->GetGlobalGenerator()->GenerateBuildCommand
|
||||||
(makeprogram.c_str(), this->Makefile->GetProjectName(), 0,
|
(makeprogram.c_str(), this->Makefile->GetProjectName(), 0,
|
||||||
0, "Release", true);
|
0, "Release", true, false);
|
||||||
|
|
||||||
if(cacheValue)
|
if(cacheValue)
|
||||||
{
|
{
|
||||||
|
@ -770,13 +770,13 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
|
|||||||
const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
||||||
return this->Build(srcdir,bindir,projectName,
|
return this->Build(srcdir,bindir,projectName,
|
||||||
newTarget.c_str(),
|
newTarget.c_str(),
|
||||||
output,makeCommand.c_str(),config,false);
|
output,makeCommand.c_str(),config,false,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGlobalGenerator
|
std::string cmGlobalGenerator
|
||||||
::GenerateBuildCommand(const char* makeProgram, const char *projectName,
|
::GenerateBuildCommand(const char* makeProgram, const char *projectName,
|
||||||
const char* additionalOptions, const char *targetName,
|
const char* additionalOptions, const char *targetName,
|
||||||
const char* config, bool ignoreErrors)
|
const char* config, bool ignoreErrors, bool)
|
||||||
{
|
{
|
||||||
// Project name and config are not used yet.
|
// Project name and config are not used yet.
|
||||||
(void)projectName;
|
(void)projectName;
|
||||||
@ -814,7 +814,7 @@ int cmGlobalGenerator::Build(
|
|||||||
std::string *output,
|
std::string *output,
|
||||||
const char *makeCommandCSTR,
|
const char *makeCommandCSTR,
|
||||||
const char *config,
|
const char *config,
|
||||||
bool clean)
|
bool clean, bool fast)
|
||||||
{
|
{
|
||||||
*output += "\nTesting TryCompileWithoutMakefile\n";
|
*output += "\nTesting TryCompileWithoutMakefile\n";
|
||||||
|
|
||||||
@ -834,7 +834,7 @@ int cmGlobalGenerator::Build(
|
|||||||
{
|
{
|
||||||
std::string cleanCommand =
|
std::string cleanCommand =
|
||||||
this->GenerateBuildCommand(makeCommandCSTR, projectName,
|
this->GenerateBuildCommand(makeCommandCSTR, projectName,
|
||||||
0, "clean", config, false);
|
0, "clean", config, false, fast);
|
||||||
if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), output,
|
if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), output,
|
||||||
&retVal, 0, false, timeout))
|
&retVal, 0, false, timeout))
|
||||||
{
|
{
|
||||||
@ -854,7 +854,7 @@ int cmGlobalGenerator::Build(
|
|||||||
// now build
|
// now build
|
||||||
std::string makeCommand =
|
std::string makeCommand =
|
||||||
this->GenerateBuildCommand(makeCommandCSTR, projectName,
|
this->GenerateBuildCommand(makeCommandCSTR, projectName,
|
||||||
0, target, config, false);
|
0, target, config, false, fast);
|
||||||
|
|
||||||
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
|
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
|
||||||
&retVal, 0, false, timeout))
|
&retVal, 0, false, timeout))
|
||||||
|
@ -100,12 +100,12 @@ public:
|
|||||||
const char *projectName, const char *targetName,
|
const char *projectName, const char *targetName,
|
||||||
std::string *output,
|
std::string *output,
|
||||||
const char *makeProgram, const char *config,
|
const char *makeProgram, const char *config,
|
||||||
bool clean);
|
bool clean, bool fast);
|
||||||
virtual std::string GenerateBuildCommand
|
virtual std::string GenerateBuildCommand
|
||||||
(const char* makeProgram,
|
(const char* makeProgram,
|
||||||
const char *projectName, const char* additionalOptions,
|
const char *projectName, const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config, bool ignoreErrors);
|
const char* config, bool ignoreErrors, bool fast);
|
||||||
|
|
||||||
|
|
||||||
///! Set the CMake instance
|
///! Set the CMake instance
|
||||||
|
@ -597,7 +597,7 @@ cmGlobalUnixMakefileGenerator3
|
|||||||
std::string cmGlobalUnixMakefileGenerator3
|
std::string cmGlobalUnixMakefileGenerator3
|
||||||
::GenerateBuildCommand(const char* makeProgram, const char *projectName,
|
::GenerateBuildCommand(const char* makeProgram, const char *projectName,
|
||||||
const char* additionalOptions, const char *targetName,
|
const char* additionalOptions, const char *targetName,
|
||||||
const char* config, bool ignoreErrors)
|
const char* config, bool ignoreErrors, bool fast)
|
||||||
{
|
{
|
||||||
// Project name and config are not used yet.
|
// Project name and config are not used yet.
|
||||||
(void)projectName;
|
(void)projectName;
|
||||||
@ -644,7 +644,10 @@ std::string cmGlobalUnixMakefileGenerator3
|
|||||||
lg->SetupPathConversions();
|
lg->SetupPathConversions();
|
||||||
makeCommand += " \"";
|
makeCommand += " \"";
|
||||||
std::string tname = targetName;
|
std::string tname = targetName;
|
||||||
tname += "/fast";
|
if(fast)
|
||||||
|
{
|
||||||
|
tname += "/fast";
|
||||||
|
}
|
||||||
tname = lg->Convert(tname.c_str(),cmLocalGenerator::HOME_OUTPUT,
|
tname = lg->Convert(tname.c_str(),cmLocalGenerator::HOME_OUTPUT,
|
||||||
cmLocalGenerator::MAKEFILE);
|
cmLocalGenerator::MAKEFILE);
|
||||||
tname = lg->ConvertToMakeTarget(tname.c_str());
|
tname = lg->ConvertToMakeTarget(tname.c_str());
|
||||||
|
@ -121,7 +121,7 @@ public:
|
|||||||
(const char* makeProgram,
|
(const char* makeProgram,
|
||||||
const char *projectName, const char* additionalOptions,
|
const char *projectName, const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config, bool ignoreErrors);
|
const char* config, bool ignoreErrors, bool fast);
|
||||||
|
|
||||||
// returns true if a progress rule should be added
|
// returns true if a progress rule should be added
|
||||||
int ShouldAddProgressRule();
|
int ShouldAddProgressRule();
|
||||||
|
@ -73,7 +73,8 @@ std::string cmGlobalVisualStudio6Generator
|
|||||||
const char* additionalOptions,
|
const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config,
|
const char* config,
|
||||||
bool ignoreErrors)
|
bool ignoreErrors,
|
||||||
|
bool)
|
||||||
{
|
{
|
||||||
// Ingoring errors is not implemented in visual studio 6
|
// Ingoring errors is not implemented in visual studio 6
|
||||||
(void) ignoreErrors;
|
(void) ignoreErrors;
|
||||||
|
@ -60,7 +60,8 @@ public:
|
|||||||
const char* additionalOptions,
|
const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config,
|
const char* config,
|
||||||
bool ignoreErrors);
|
bool ignoreErrors,
|
||||||
|
bool fast);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
|
@ -71,7 +71,7 @@ std::string cmGlobalVisualStudio7Generator
|
|||||||
::GenerateBuildCommand(const char* makeProgram,
|
::GenerateBuildCommand(const char* makeProgram,
|
||||||
const char *projectName,
|
const char *projectName,
|
||||||
const char* additionalOptions, const char *targetName,
|
const char* additionalOptions, const char *targetName,
|
||||||
const char* config, bool ignoreErrors)
|
const char* config, bool ignoreErrors, bool)
|
||||||
{
|
{
|
||||||
// Ingoring errors is not implemented in visual studio 6
|
// Ingoring errors is not implemented in visual studio 6
|
||||||
(void) ignoreErrors;
|
(void) ignoreErrors;
|
||||||
|
@ -60,7 +60,8 @@ public:
|
|||||||
const char* additionalOptions,
|
const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config,
|
const char* config,
|
||||||
bool ignoreErrors);
|
bool ignoreErrors,
|
||||||
|
bool fast);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
|
@ -133,7 +133,8 @@ std::string cmGlobalXCodeGenerator
|
|||||||
const char* additionalOptions,
|
const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config,
|
const char* config,
|
||||||
bool ignoreErrors)
|
bool ignoreErrors,
|
||||||
|
bool)
|
||||||
{
|
{
|
||||||
// Config is not used yet
|
// Config is not used yet
|
||||||
(void) ignoreErrors;
|
(void) ignoreErrors;
|
||||||
|
@ -63,7 +63,8 @@ public:
|
|||||||
const char* additionalOptions,
|
const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config,
|
const char* config,
|
||||||
bool ignoreErrors);
|
bool ignoreErrors,
|
||||||
|
bool fast);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
|
Loading…
x
Reference in New Issue
Block a user