From da8faa8c7e54df0abbdfd50c29235320164453aa Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 20 Apr 2017 21:26:11 +0200 Subject: cmState: remove RemoveUnscriptableCommands --- Source/CPack/cpack.cxx | 2 -- Source/CTest/cmCTestScriptHandler.cxx | 4 ---- Source/cmState.cxx | 15 --------------- Source/cmState.h | 1 - 4 files changed, 22 deletions(-) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index bf25e65..a44bc3d 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -23,7 +23,6 @@ #include "cmDocumentationEntry.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" -#include "cmState.h" #include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cm_auto_ptr.hxx" @@ -193,7 +192,6 @@ int main(int argc, char const* const* argv) cminst.SetHomeDirectory(""); cminst.SetHomeOutputDirectory(""); cminst.GetCurrentSnapshot().SetDefaultDefinitions(); - cminst.GetState()->RemoveUnscriptableCommands(); cmGlobalGenerator cmgg(&cminst); CM_AUTO_PTR globalMF( new cmMakefile(&cmgg, cminst.GetCurrentSnapshot())); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 444d0e3..1fea8e5 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -290,10 +290,6 @@ void cmCTestScriptHandler::CreateCMake() this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); - // remove all cmake commands which are not scriptable, since they can't be - // used in ctest scripts - this->CMake->GetState()->RemoveUnscriptableCommands(); - // add any ctest specific commands, probably should have common superclass // for ctest commands to clean this up. If a couple more commands are // created with the same format lets do that - ken diff --git a/Source/cmState.cxx b/Source/cmState.cxx index aca0358..43f439c 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -410,21 +410,6 @@ void cmState::AddCommand(cmCommand* command) this->Commands.insert(std::make_pair(name, command)); } -void cmState::RemoveUnscriptableCommands() -{ - std::vector unscriptableCommands; - for (std::map::iterator pos = - this->Commands.begin(); - pos != this->Commands.end();) { - if (!pos->second->IsScriptable()) { - delete pos->second; - this->Commands.erase(pos++); - } else { - ++pos; - } - } -} - cmCommand* cmState::GetCommand(std::string const& name) const { cmCommand* command = CM_NULLPTR; diff --git a/Source/cmState.h b/Source/cmState.h index d2af5ce..240d75b 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -121,7 +121,6 @@ public: cmCommand* GetCommand(std::string const& name) const; void AddCommand(cmCommand* command); - void RemoveUnscriptableCommands(); void RenameCommand(std::string const& oldName, std::string const& newName); void RemoveUserDefinedCommands(); std::vector GetCommandNames() const; -- cgit v0.12