ENH: Add option to ignore errors. Only works on make
This commit is contained in:
parent
48702f8a8d
commit
61d0a75d11
@ -651,7 +651,8 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGlobalGenerator::GenerateBuildCommand(const char* makeProgram,
|
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.
|
// Project name and config are not used yet.
|
||||||
(void)projectName;
|
(void)projectName;
|
||||||
@ -659,21 +660,21 @@ std::string cmGlobalGenerator::GenerateBuildCommand(const char* makeProgram,
|
|||||||
|
|
||||||
std::string makeCommand = makeProgram;
|
std::string makeCommand = makeProgram;
|
||||||
makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str());
|
makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str());
|
||||||
makeCommand += " ";
|
|
||||||
// Since we have full control over the invocation of nmake, let us
|
// Since we have full control over the invocation of nmake, let us
|
||||||
// make it quiet.
|
// make it quiet.
|
||||||
if ( strcmp(this->GetName(), "NMake Makefiles") == 0 )
|
if ( strcmp(this->GetName(), "NMake Makefiles") == 0 )
|
||||||
{
|
{
|
||||||
makeCommand += "/NOLOGO ";
|
makeCommand += " /NOLOGO ";
|
||||||
|
}
|
||||||
|
if ( ignoreErrors )
|
||||||
|
{
|
||||||
|
makeCommand += " -i";
|
||||||
}
|
}
|
||||||
if ( targetName )
|
if ( targetName )
|
||||||
{
|
{
|
||||||
|
makeCommand += " ";
|
||||||
makeCommand += targetName;
|
makeCommand += targetName;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
makeCommand += "all";
|
|
||||||
}
|
|
||||||
return makeCommand;
|
return makeCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -701,7 +702,7 @@ int cmGlobalGenerator::Build(
|
|||||||
// should we do a clean first?
|
// should we do a clean first?
|
||||||
if (clean)
|
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,
|
if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), output,
|
||||||
&retVal, 0, false, timeout))
|
&retVal, 0, false, timeout))
|
||||||
{
|
{
|
||||||
@ -719,7 +720,7 @@ int cmGlobalGenerator::Build(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// now 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,
|
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
|
||||||
&retVal, 0, false, timeout))
|
&retVal, 0, false, timeout))
|
||||||
|
@ -99,7 +99,7 @@ public:
|
|||||||
const char *makeProgram, const char *config,
|
const char *makeProgram, const char *config,
|
||||||
bool clean);
|
bool clean);
|
||||||
virtual std::string GenerateBuildCommand(const char* makeProgram, const char *projectName, const char *targetName,
|
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
|
///! Set the CMake instance
|
||||||
void SetCMakeInstance(cmake *cm) {
|
void SetCMakeInstance(cmake *cm) {
|
||||||
|
@ -67,9 +67,12 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGlobalVisualStudio6Generator::GenerateBuildCommand(const char* makeProgram, const char *projectName, const char *targetName,
|
std::string cmGlobalVisualStudio6Generator::GenerateBuildCommand(const char* makeProgram,
|
||||||
const char* config)
|
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
|
// now build the test
|
||||||
std::vector<std::string> mp;
|
std::vector<std::string> mp;
|
||||||
mp.push_back("[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin");
|
mp.push_back("[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin");
|
||||||
|
@ -55,7 +55,8 @@ public:
|
|||||||
* loaded commands, not as part of the usual build process.
|
* loaded commands, not as part of the usual build process.
|
||||||
*/
|
*/
|
||||||
virtual std::string GenerateBuildCommand(const char* makeProgram,
|
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
|
* Generate the all required files for building this project/tree. This
|
||||||
|
@ -43,8 +43,12 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons
|
|||||||
this->cmGlobalGenerator::EnableLanguage(lang, mf);
|
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
|
// now build the test
|
||||||
std::string makeCommand =
|
std::string makeCommand =
|
||||||
cmSystemTools::ConvertToOutputPath(makeProgram);
|
cmSystemTools::ConvertToOutputPath(makeProgram);
|
||||||
|
@ -54,7 +54,8 @@ public:
|
|||||||
* loaded commands, not as part of the usual build process.
|
* loaded commands, not as part of the usual build process.
|
||||||
*/
|
*/
|
||||||
virtual std::string GenerateBuildCommand(const char* makeProgram,
|
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
|
* Generate the all required files for building this project/tree. This
|
||||||
|
@ -52,7 +52,8 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmGlobalXCodeGenerator::GenerateBuildCommand(const char* makeProgram,
|
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
|
// Config is not used yet
|
||||||
(void) config;
|
(void) config;
|
||||||
|
@ -58,7 +58,8 @@ public:
|
|||||||
* loaded commands, not as part of the usual build process.
|
* loaded commands, not as part of the usual build process.
|
||||||
*/
|
*/
|
||||||
virtual std::string GenerateBuildCommand(const char* makeProgram,
|
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
|
* Generate the all required files for building this project/tree. This
|
||||||
|
Loading…
x
Reference in New Issue
Block a user