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:
Brad King 2006-06-01 15:51:24 -04:00
parent bfb0ec58e8
commit 87d4d0e039
14 changed files with 28 additions and 20 deletions

View File

@ -346,7 +346,7 @@ int cmCPackGenericGenerator::InstallProject()
= globalGenerator->GenerateBuildCommand(cmakeMakeProgram,
installProjectName.c_str(), 0,
globalGenerator->GetPreinstallTargetName(),
buildConfig, false);
buildConfig, false, false);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Install command: " << buildCommand << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,

View File

@ -196,7 +196,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
this->SourceDir.c_str(), this->BinaryDir.c_str(),
this->BuildProject.c_str(), tarIt->c_str(),
&output, this->BuildMakeProgram.c_str(),
this->CTest->GetConfigType().c_str(),!this->BuildNoClean);
this->CTest->GetConfigType().c_str(),!this->BuildNoClean, false);
out << output;
// if the build failed then return

View File

@ -93,7 +93,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
std::string buildCommand
= this->GlobalGenerator->GenerateBuildCommand(cmakeMakeProgram,
cmakeProjectName,
cmakeBuildAdditionalFlags, 0, cmakeBuildConfiguration, true);
cmakeBuildAdditionalFlags, 0, cmakeBuildConfiguration, true, false);
this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str());
}
else

View File

@ -34,7 +34,7 @@ bool cmBuildCommand::InitialPass(std::vector<std::string> const& args)
std::string makecommand = this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->GenerateBuildCommand
(makeprogram.c_str(), this->Makefile->GetProjectName(), 0,
0, "Release", true);
0, "Release", true, false);
if(cacheValue)
{

View File

@ -770,13 +770,13 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
return this->Build(srcdir,bindir,projectName,
newTarget.c_str(),
output,makeCommand.c_str(),config,false);
output,makeCommand.c_str(),config,false,true);
}
std::string cmGlobalGenerator
::GenerateBuildCommand(const char* makeProgram, const char *projectName,
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.
(void)projectName;
@ -814,7 +814,7 @@ int cmGlobalGenerator::Build(
std::string *output,
const char *makeCommandCSTR,
const char *config,
bool clean)
bool clean, bool fast)
{
*output += "\nTesting TryCompileWithoutMakefile\n";
@ -834,7 +834,7 @@ int cmGlobalGenerator::Build(
{
std::string cleanCommand =
this->GenerateBuildCommand(makeCommandCSTR, projectName,
0, "clean", config, false);
0, "clean", config, false, fast);
if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), output,
&retVal, 0, false, timeout))
{
@ -854,7 +854,7 @@ int cmGlobalGenerator::Build(
// now build
std::string makeCommand =
this->GenerateBuildCommand(makeCommandCSTR, projectName,
0, target, config, false);
0, target, config, false, fast);
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
&retVal, 0, false, timeout))

View File

@ -100,12 +100,12 @@ public:
const char *projectName, const char *targetName,
std::string *output,
const char *makeProgram, const char *config,
bool clean);
bool clean, bool fast);
virtual std::string GenerateBuildCommand
(const char* makeProgram,
const char *projectName, const char* additionalOptions,
const char *targetName,
const char* config, bool ignoreErrors);
const char* config, bool ignoreErrors, bool fast);
///! Set the CMake instance

View File

@ -597,7 +597,7 @@ cmGlobalUnixMakefileGenerator3
std::string cmGlobalUnixMakefileGenerator3
::GenerateBuildCommand(const char* makeProgram, const char *projectName,
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.
(void)projectName;
@ -644,7 +644,10 @@ std::string cmGlobalUnixMakefileGenerator3
lg->SetupPathConversions();
makeCommand += " \"";
std::string tname = targetName;
tname += "/fast";
if(fast)
{
tname += "/fast";
}
tname = lg->Convert(tname.c_str(),cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE);
tname = lg->ConvertToMakeTarget(tname.c_str());

View File

@ -121,7 +121,7 @@ public:
(const char* makeProgram,
const char *projectName, const char* additionalOptions,
const char *targetName,
const char* config, bool ignoreErrors);
const char* config, bool ignoreErrors, bool fast);
// returns true if a progress rule should be added
int ShouldAddProgressRule();

View File

@ -73,7 +73,8 @@ std::string cmGlobalVisualStudio6Generator
const char* additionalOptions,
const char *targetName,
const char* config,
bool ignoreErrors)
bool ignoreErrors,
bool)
{
// Ingoring errors is not implemented in visual studio 6
(void) ignoreErrors;

View File

@ -60,7 +60,8 @@ public:
const char* additionalOptions,
const char *targetName,
const char* config,
bool ignoreErrors);
bool ignoreErrors,
bool fast);
/**
* Generate the all required files for building this project/tree. This

View File

@ -71,7 +71,7 @@ std::string cmGlobalVisualStudio7Generator
::GenerateBuildCommand(const char* makeProgram,
const char *projectName,
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
(void) ignoreErrors;

View File

@ -60,7 +60,8 @@ public:
const char* additionalOptions,
const char *targetName,
const char* config,
bool ignoreErrors);
bool ignoreErrors,
bool fast);
/**
* Generate the all required files for building this project/tree. This

View File

@ -133,7 +133,8 @@ std::string cmGlobalXCodeGenerator
const char* additionalOptions,
const char *targetName,
const char* config,
bool ignoreErrors)
bool ignoreErrors,
bool)
{
// Config is not used yet
(void) ignoreErrors;

View File

@ -63,7 +63,8 @@ public:
const char* additionalOptions,
const char *targetName,
const char* config,
bool ignoreErrors);
bool ignoreErrors,
bool fast);
/**
* Generate the all required files for building this project/tree. This