summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalCommonGenerator.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/cmGlobalCommonGenerator.cxx
parent101b5288ffa988b86fc1fe83f3ff65c9694b1484 (diff)
downloadCMake-f93385283fc86639c0a13b920c66c3a8f42276bb.zip
CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.tar.gz
CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.tar.bz2
cmLocalGenerator: modernize memory management
Diffstat (limited to 'Source/cmGlobalCommonGenerator.cxx')
-rw-r--r--Source/cmGlobalCommonGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx
index 9fa4467..d6c0a87 100644
--- a/Source/cmGlobalCommonGenerator.cxx
+++ b/Source/cmGlobalCommonGenerator.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGlobalCommonGenerator.h"
+#include <memory>
#include <utility>
#include "cmGeneratorTarget.h"
@@ -32,7 +33,7 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const
// The directory-level rule should depend on the target-level rules
// for all targets in the directory.
- for (auto gt : lg->GetGeneratorTargets()) {
+ for (const auto& gt : lg->GetGeneratorTargets()) {
cmStateEnums::TargetType const type = gt->GetType();
if (type != cmStateEnums::EXECUTABLE &&
type != cmStateEnums::STATIC_LIBRARY &&
@@ -43,7 +44,7 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const
continue;
}
DirectoryTarget::Target t;
- t.GT = gt;
+ t.GT = gt.get();
if (const char* exclude = gt->GetProperty("EXCLUDE_FROM_ALL")) {
if (cmIsOn(exclude)) {
// This target has been explicitly excluded.