diff options
author | Brad King <brad.king@kitware.com> | 2019-01-25 13:09:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-25 13:09:37 (GMT) |
commit | 40628b2519ae1553a33f701cf46ee8fbbd013b85 (patch) | |
tree | 7355225a83e125ce7b650967b6798b4ebbf8739a /Source/CTest | |
parent | 24b6e4830d9027e63db7dfafa500aaeb652d3a4c (diff) | |
parent | a6982cff0d3910723ad4fd40b9c63cf77c872d30 (diff) | |
download | CMake-40628b2519ae1553a33f701cf46ee8fbbd013b85.zip CMake-40628b2519ae1553a33f701cf46ee8fbbd013b85.tar.gz CMake-40628b2519ae1553a33f701cf46ee8fbbd013b85.tar.bz2 |
Merge topic 'max-recursion-depth'
a6982cff0d cmMakefile: Impose maximum recursion limit
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Juraj Oršulić <juraj.orsulic@fer.hr>
Merge-request: !2746
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestRunScriptCommand.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 12 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.h | 5 |
3 files changed, 15 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestRunScriptCommand.cxx b/Source/CTest/cmCTestRunScriptCommand.cxx index 238284a..a7e47d3 100644 --- a/Source/CTest/cmCTestRunScriptCommand.cxx +++ b/Source/CTest/cmCTestRunScriptCommand.cxx @@ -39,7 +39,8 @@ bool cmCTestRunScriptCommand::InitialPass(std::vector<std::string> const& args, ++i; } else { int ret; - cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, &ret); + cmCTestScriptHandler::RunScript(this->CTest, this->Makefile, + args[i].c_str(), !np, &ret); std::ostringstream str; str << ret; this->Makefile->AddDefinition(returnVariable, str.str().c_str()); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index f417f53..b949023 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -78,6 +78,7 @@ cmCTestScriptHandler::cmCTestScriptHandler() this->EmptyBinDir = false; this->EmptyBinDirOnce = false; this->Makefile = nullptr; + this->ParentMakefile = nullptr; this->CMake = nullptr; this->GlobalGenerator = nullptr; @@ -117,6 +118,7 @@ void cmCTestScriptHandler::Initialize() delete this->Makefile; this->Makefile = nullptr; + this->ParentMakefile = nullptr; delete this->GlobalGenerator; this->GlobalGenerator = nullptr; @@ -292,6 +294,10 @@ void cmCTestScriptHandler::CreateCMake() snapshot.GetDirectory().SetCurrentSource(cwd); snapshot.GetDirectory().SetCurrentBinary(cwd); this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot); + if (this->ParentMakefile) { + this->Makefile->SetRecursionDepth( + this->ParentMakefile->GetRecursionDepth()); + } this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); @@ -891,11 +897,13 @@ void cmCTestScriptHandler::RestoreBackupDirectories() } } -bool cmCTestScriptHandler::RunScript(cmCTest* ctest, const char* sname, - bool InProcess, int* returnValue) +bool cmCTestScriptHandler::RunScript(cmCTest* ctest, cmMakefile* mf, + const char* sname, bool InProcess, + int* returnValue) { cmCTestScriptHandler* sh = new cmCTestScriptHandler(); sh->SetCTestInstance(ctest); + sh->ParentMakefile = mf; sh->AddConfigurationScript(sname, InProcess); int res = sh->ProcessHandler(); if (returnValue) { diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index cf0762e..d93b5f8 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -72,8 +72,8 @@ public: /* * Run a script */ - static bool RunScript(cmCTest* ctest, const char* script, bool InProcess, - int* returnValue); + static bool RunScript(cmCTest* ctest, cmMakefile* mf, const char* script, + bool InProcess, int* returnValue); int RunCurrentScript(); /* @@ -166,6 +166,7 @@ private: std::chrono::steady_clock::time_point ScriptStartTime; cmMakefile* Makefile; + cmMakefile* ParentMakefile; cmGlobalGenerator* GlobalGenerator; cmake* CMake; }; |