summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalCommonGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalCommonGenerator.cxx')
-rw-r--r--Source/cmGlobalCommonGenerator.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx
index 9fa4467..e04eef1 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"
@@ -24,15 +25,15 @@ std::map<std::string, cmGlobalCommonGenerator::DirectoryTarget>
cmGlobalCommonGenerator::ComputeDirectoryTargets() const
{
std::map<std::string, DirectoryTarget> dirTargets;
- for (cmLocalGenerator* lg : this->LocalGenerators) {
+ for (const auto& lg : this->LocalGenerators) {
std::string const& currentBinaryDir(
lg->GetStateSnapshot().GetDirectory().GetCurrentBinary());
DirectoryTarget& dirTarget = dirTargets[currentBinaryDir];
- dirTarget.LG = lg;
+ dirTarget.LG = lg.get();
// 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.