ENH: Add option to ignore errors. Only works on make

This commit is contained in:
Andy Cedilnik 2005-04-29 11:49:18 -04:00
parent 48702f8a8d
commit 61d0a75d11
8 changed files with 29 additions and 17 deletions

View File

@ -651,7 +651,8 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
}
std::string cmGlobalGenerator::GenerateBuildCommand(const char* makeProgram,
const char *projectName, const char *targetName, const char* config)
const char *projectName, const char *targetName, const char* config,
bool ignoreErrors)
{
// Project name and config are not used yet.
(void)projectName;
@ -659,21 +660,21 @@ std::string cmGlobalGenerator::GenerateBuildCommand(const char* makeProgram,
std::string makeCommand = makeProgram;
makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str());
makeCommand += " ";
// Since we have full control over the invocation of nmake, let us
// make it quiet.
if ( strcmp(this->GetName(), "NMake Makefiles") == 0 )
{
makeCommand += "/NOLOGO ";
makeCommand += " /NOLOGO ";
}
if ( ignoreErrors )
{
makeCommand += " -i";
}
if ( targetName )
{
makeCommand += " ";
makeCommand += targetName;
}
else
{
makeCommand += "all";
}
return makeCommand;
}
@ -701,7 +702,7 @@ int cmGlobalGenerator::Build(
// should we do a clean first?
if (clean)
{
std::string cleanCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName, "clean", config);
std::string cleanCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName, "clean", config, false);
if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), output,
&retVal, 0, false, timeout))
{
@ -719,7 +720,7 @@ int cmGlobalGenerator::Build(
}
// now build
std::string makeCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName, target, config);
std::string makeCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName, target, config, false);
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
&retVal, 0, false, timeout))

View File

@ -99,7 +99,7 @@ public:
const char *makeProgram, const char *config,
bool clean);
virtual std::string GenerateBuildCommand(const char* makeProgram, const char *projectName, const char *targetName,
const char* config);
const char* config, bool ignoreErrors);
///! Set the CMake instance
void SetCMakeInstance(cmake *cm) {

View File

@ -67,9 +67,12 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf)
}
}
std::string cmGlobalVisualStudio6Generator::GenerateBuildCommand(const char* makeProgram, const char *projectName, const char *targetName,
const char* config)
std::string cmGlobalVisualStudio6Generator::GenerateBuildCommand(const char* makeProgram,
const char *projectName, const char *targetName, const char* config, bool ignoreErrors)
{
// Ingoring errors is not implemented in visual studio 6
(void) ignoreErrors;
// now build the test
std::vector<std::string> mp;
mp.push_back("[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin");

View File

@ -55,7 +55,8 @@ public:
* loaded commands, not as part of the usual build process.
*/
virtual std::string GenerateBuildCommand(const char* makeProgram,
const char *projectName, const char *targetName, const char* config);
const char *projectName, const char *targetName, const char* config,
bool ignoreErrors);
/**
* Generate the all required files for building this project/tree. This

View File

@ -43,8 +43,12 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons
this->cmGlobalGenerator::EnableLanguage(lang, mf);
}
std::string cmGlobalVisualStudio7Generator::GenerateBuildCommand(const char* makeProgram, const char *projectName, const char *targetName, const char* config)
std::string cmGlobalVisualStudio7Generator::GenerateBuildCommand(const char* makeProgram,
const char *projectName, const char *targetName, const char* config, bool ignoreErrors)
{
// Ingoring errors is not implemented in visual studio 6
(void) ignoreErrors;
// now build the test
std::string makeCommand =
cmSystemTools::ConvertToOutputPath(makeProgram);

View File

@ -54,7 +54,8 @@ public:
* loaded commands, not as part of the usual build process.
*/
virtual std::string GenerateBuildCommand(const char* makeProgram,
const char *projectName, const char *targetName, const char* config);
const char *projectName, const char *targetName, const char* config,
bool ignoreErrors);
/**
* Generate the all required files for building this project/tree. This

View File

@ -52,7 +52,8 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
//----------------------------------------------------------------------------
std::string cmGlobalXCodeGenerator::GenerateBuildCommand(const char* makeProgram,
const char *projectName, const char *targetName, const char* config)
const char *projectName, const char *targetName, const char* config,
bool ignoreErrors)
{
// Config is not used yet
(void) config;

View File

@ -58,7 +58,8 @@ public:
* loaded commands, not as part of the usual build process.
*/
virtual std::string GenerateBuildCommand(const char* makeProgram,
const char *projectName, const char *targetName, const char* config);
const char *projectName, const char *targetName, const char* config,
bool ignoreErrors);
/**
* Generate the all required files for building this project/tree. This