From 0b150f69c2a724b8ec097ca1657c089a6e2861e8 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Sun, 3 Aug 2003 22:34:37 -0400 Subject: ENH: Use the new RunCommand --- Source/cmGlobalGenerator.cxx | 6 +++++- Source/cmGlobalGenerator.h | 1 + Source/cmGlobalVisualStudio6Generator.cxx | 6 ++++-- Source/cmGlobalVisualStudio7Generator.cxx | 7 ++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 96706d8..e5b83e8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -24,6 +24,8 @@ #include #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 diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 54efa76..20dcc08 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -102,6 +102,7 @@ public: void SetConfiguredFilesPath(const char* s){m_ConfiguredFilesPath = s;} void GetLocalGenerators(std::vector&g) { g = m_LocalGenerators;} + static int s_TryCompileTimeout; protected: cmStdString m_FindMakeProgramFile; diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 233a9e2..b04713a 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -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; diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 4486f3c..11032ce 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -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 -- cgit v0.12