ENH: Use the new RunCommand

This commit is contained in:
Andy Cedilnik 2003-08-03 22:34:37 -04:00
parent 32c2ed2ef3
commit 0b150f69c2
4 changed files with 14 additions and 6 deletions

View File

@ -24,6 +24,8 @@
#include <windows.h>
#endif
int cmGlobalGenerator::s_TryCompileTimeout = 0;
cmGlobalGenerator::cmGlobalGenerator()
{
// do nothing duh
@ -485,7 +487,9 @@ int cmGlobalGenerator::TryCompile(const char *, const char *bindir,
makeCommand += " all";
}
int retVal;
if (!cmSystemTools::RunCommand(makeCommand.c_str(), *output, retVal, 0, false))
int timeout = cmGlobalGenerator::s_TryCompileTimeout;
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
&retVal, 0, false, timeout))
{
cmSystemTools::Error("Generator: execution of make failed.");
// return to the original directory

View File

@ -102,6 +102,7 @@ public:
void SetConfiguredFilesPath(const char* s){m_ConfiguredFilesPath = s;}
void GetLocalGenerators(std::vector<cmLocalGenerator *>&g) { g = m_LocalGenerators;}
static int s_TryCompileTimeout;
protected:
cmStdString m_FindMakeProgramFile;

View File

@ -96,7 +96,7 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
cmSystemTools::ChangeDirectory(bindir);
// if there are spaces in the makeCommand, assume a full path
// and convert it to a path with no spaces in it as the
// RunCommand does not like spaces
// RunSingleCommand does not like spaces
#if defined(_WIN32) && !defined(__CYGWIN__)
if(makeCommand.find(' ') != std::string::npos)
{
@ -116,7 +116,9 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
}
makeCommand += " - Debug\"";
int retVal;
if (!cmSystemTools::RunCommand(makeCommand.c_str(), *output, retVal, 0, false))
int timeout = cmGlobalGenerator::s_TryCompileTimeout;
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
&retVal, 0, false, timeout))
{
std::string e = "Error executing make program \"";
e += originalCommand;

View File

@ -66,7 +66,7 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
// if there are spaces in the makeCommand, assume a full path
// and convert it to a path with no spaces in it as the
// RunCommand does not like spaces
// RunSingleCommand does not like spaces
#if defined(_WIN32) && !defined(__CYGWIN__)
if(makeCommand.find(' ') != std::string::npos)
{
@ -86,8 +86,9 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
}
int retVal;
if (!cmSystemTools::RunCommand(makeCommand.c_str(), *output, retVal,
0, false))
int timeout = cmGlobalGenerator::s_TryCompileTimeout;
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, &retVal,
0, false, timeout))
{
cmSystemTools::Error("Generator: execution of devenv failed.");
// return to the original directory