diff options
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r-- | Source/cmIfCommand.cxx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index d1f8f58..625dd45 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIfCommand.h" +#include "cm_memory.hxx" + #include "cmConditionEvaluator.h" #include "cmExecutionStatus.h" #include "cmExpandedCommandArgument.h" @@ -11,7 +13,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <memory> // IWYU pragma: keep +#include <utility> static std::string cmIfCommandError( std::vector<cmExpandedCommandArgument> const& args) @@ -202,15 +204,17 @@ bool cmIfCommand::InvokeInitialPass( this->Makefile->IssueMessage(status, err); } - cmIfFunctionBlocker* f = new cmIfFunctionBlocker(); - // if is isn't true block the commands - f->ScopeDepth = 1; - f->IsBlocking = !isTrue; - if (isTrue) { - f->HasRun = true; + { + auto fb = cm::make_unique<cmIfFunctionBlocker>(); + // if is isn't true block the commands + fb->ScopeDepth = 1; + fb->IsBlocking = !isTrue; + if (isTrue) { + fb->HasRun = true; + } + fb->Args = args; + this->Makefile->AddFunctionBlocker(std::move(fb)); } - f->Args = args; - this->Makefile->AddFunctionBlocker(f); return true; } |