summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-11-07 17:52:06 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2019-11-11 15:41:13 (GMT)
commitf93385283fc86639c0a13b920c66c3a8f42276bb (patch)
tree7fa219d170720581d6d8438d0be6a1162e0c3b51 /Source/cmGlobalVisualStudioGenerator.cxx
parent101b5288ffa988b86fc1fe83f3ff65c9694b1484 (diff)
downloadCMake-f93385283fc86639c0a13b920c66c3a8f42276bb.zip
CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.tar.gz
CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.tar.bz2
cmLocalGenerator: modernize memory management
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 5412407..2181994 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -7,6 +7,7 @@
#include <iostream>
#include <cm/iterator>
+#include <cm/memory>
#include <windows.h>
@@ -200,8 +201,8 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
"ALL_BUILD", cmCommandOrigin::Generator, true, no_working_dir,
no_byproducts, no_depends, no_commands, false, "Build all projects");
- cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
- gen[0]->AddGeneratorTarget(gt);
+ gen[0]->AddGeneratorTarget(
+ cm::make_unique<cmGeneratorTarget>(allBuild, gen[0]));
//
// Organize in the "predefined targets" folder:
@@ -212,12 +213,12 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
// Now make all targets depend on the ALL_BUILD target
for (cmLocalGenerator const* i : gen) {
- for (cmGeneratorTarget* tgt : i->GetGeneratorTargets()) {
+ for (const auto& tgt : i->GetGeneratorTargets()) {
if (tgt->GetType() == cmStateEnums::GLOBAL_TARGET ||
tgt->IsImported()) {
continue;
}
- if (!this->IsExcluded(gen[0], tgt)) {
+ if (!this->IsExcluded(gen[0], tgt.get())) {
allBuild->AddUtility(tgt->GetName());
}
}
@@ -389,8 +390,8 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
}
for (auto const& it : this->ProjectMap) {
for (const cmLocalGenerator* i : it.second) {
- for (cmGeneratorTarget* ti : i->GetGeneratorTargets()) {
- this->ComputeVSTargetDepends(ti);
+ for (const auto& ti : i->GetGeneratorTargets()) {
+ this->ComputeVSTargetDepends(ti.get());
}
}
}