summaryrefslogtreecommitdiffstats
path: root/Source/cmCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCommand.cxx')
-rw-r--r--Source/cmCommand.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/cmCommand.cxx b/Source/cmCommand.cxx
index 99bdd1e..0c2734e 100644
--- a/Source/cmCommand.cxx
+++ b/Source/cmCommand.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCommand.h"
+#include <utility>
+
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
@@ -29,3 +31,29 @@ void cmCommand::SetError(const std::string& e)
{
this->Status->SetError(e);
}
+
+cmLegacyCommandWrapper::cmLegacyCommandWrapper(std::unique_ptr<cmCommand> cmd)
+ : Command(std::move(cmd))
+{
+}
+
+cmLegacyCommandWrapper::cmLegacyCommandWrapper(
+ cmLegacyCommandWrapper const& other)
+ : Command(other.Command->Clone())
+{
+}
+
+cmLegacyCommandWrapper& cmLegacyCommandWrapper::operator=(
+ cmLegacyCommandWrapper const& other)
+{
+ this->Command = other.Command->Clone();
+ return *this;
+}
+
+bool cmLegacyCommandWrapper::operator()(
+ std::vector<cmListFileArgument> const& args, cmExecutionStatus& status) const
+{
+ auto cmd = this->Command->Clone();
+ cmd->SetExecutionStatus(&status);
+ return cmd->InvokeInitialPass(args, status);
+}