summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorTushar Maheshwari <tushar27192@gmail.com>2019-08-28 16:06:21 (GMT)
committerTushar Maheshwari <tushar27192@gmail.com>2019-09-13 19:24:31 (GMT)
commit8c83f39a90b98a65a067813db1841ebcd6e0a400 (patch)
treee6b9cec43b4781f7fd0e70f85fb2d37f13111234 /Source/cmMakefile.cxx
parent19bcdca93c3a05db12652677f8d0e310797bb375 (diff)
downloadCMake-8c83f39a90b98a65a067813db1841ebcd6e0a400.zip
CMake-8c83f39a90b98a65a067813db1841ebcd6e0a400.tar.gz
CMake-8c83f39a90b98a65a067813db1841ebcd6e0a400.tar.bz2
cmSourceFile: use unique_ptr for CustomCommand
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9e64f97..6961e8e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -15,6 +15,8 @@
#include <stdlib.h>
#include <utility>
+#include "cm_memory.hxx"
+
#include "cmAlgorithms.h"
#include "cmCommandArgumentParserHelper.h"
#include "cmCustomCommand.h"
@@ -1025,7 +1027,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
depends2.push_back(main_dependency);
}
- cmCustomCommand* cc = new cmCustomCommand(
+ std::unique_ptr<cmCustomCommand> cc = cm::make_unique<cmCustomCommand>(
this, outputs, byproducts, depends2, commandLines, comment, workingDir);
cc->SetEscapeOldStyle(escapeOldStyle);
cc->SetEscapeAllowMakeVars(true);
@@ -1033,7 +1035,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
cc->SetCommandExpandLists(command_expand_lists);
cc->SetDepfile(depfile);
cc->SetJobPool(job_pool);
- file->SetCustomCommand(cc);
+ file->SetCustomCommand(std::move(cc));
this->UpdateOutputToSourceMap(outputs, file, false);
this->UpdateOutputToSourceMap(byproducts, file, true);
}