summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-12-29 10:36:48 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2019-12-30 15:55:39 (GMT)
commit5444a8095da50cdf4306d33fe137baa7711f1781 (patch)
treec0ec64b08aa5fda9f7b8bb88f263ba5128a205da /Source/cmMakefile.cxx
parent15526d4b1072647179290fb5c2d0a3a5275415c7 (diff)
downloadCMake-5444a8095da50cdf4306d33fe137baa7711f1781.zip
CMake-5444a8095da50cdf4306d33fe137baa7711f1781.tar.gz
CMake-5444a8095da50cdf4306d33fe137baa7711f1781.tar.bz2
cmGlobalGenerator: modernize memrory managemenbt
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 13a6ed7..44328d3 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -15,6 +15,7 @@
#include <utility>
#include <cm/iterator>
+#include <cm/memory>
#include <cm/optional>
#include <cmext/algorithm>
@@ -1723,8 +1724,10 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
cmSystemTools::MakeDirectory(binPath);
- cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot);
- this->GetGlobalGenerator()->AddMakefile(subMf);
+ auto subMfu =
+ cm::make_unique<cmMakefile>(this->GlobalGenerator, newSnapshot);
+ auto subMf = subMfu.get();
+ this->GetGlobalGenerator()->AddMakefile(std::move(subMfu));
if (excludeFromAll) {
subMf->SetProperty("EXCLUDE_FROM_ALL", "TRUE");