diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-04 02:34:37 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-04 02:34:37 (GMT) |
commit | 0b150f69c2a724b8ec097ca1657c089a6e2861e8 (patch) | |
tree | abe8d82ca0a9127a3e01e11afa8b2124e3950634 | |
parent | 32c2ed2ef37990060238d2e136b255d7074f6ae4 (diff) | |
download | CMake-0b150f69c2a724b8ec097ca1657c089a6e2861e8.zip CMake-0b150f69c2a724b8ec097ca1657c089a6e2861e8.tar.gz CMake-0b150f69c2a724b8ec097ca1657c089a6e2861e8.tar.bz2 |
ENH: Use the new RunCommand
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio6Generator.cxx | 6 | ||||
-rw-r--r-- | 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 <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 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<cmLocalGenerator *>&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 |