diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-01-12 15:58:54 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-01-14 10:03:07 (GMT) |
commit | f466cea3c9edffb1f524b64c514f8b7ef3913988 (patch) | |
tree | d6623a9efbd040dd7e6a091117fd642bc003b81c /Source/cmJsonObjects.cxx | |
parent | 2d5e9f3d8cf44fafcd9a3b75ebce3d6fe383fe4e (diff) | |
download | CMake-f466cea3c9edffb1f524b64c514f8b7ef3913988.zip CMake-f466cea3c9edffb1f524b64c514f8b7ef3913988.tar.gz CMake-f466cea3c9edffb1f524b64c514f8b7ef3913988.tar.bz2 |
cmMakefile: modernize memory management
Diffstat (limited to 'Source/cmJsonObjects.cxx')
-rw-r--r-- | Source/cmJsonObjects.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 54edabc..dd36386 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -487,10 +487,10 @@ static Json::Value DumpTarget(cmGeneratorTarget* target, result[kHAS_INSTALL_RULE] = true; Json::Value installPaths = Json::arrayValue; - auto targetGenerators = target->Makefile->GetInstallGenerators(); - for (auto installGenerator : targetGenerators) { + for (const auto& installGenerator : + target->Makefile->GetInstallGenerators()) { auto installTargetGenerator = - dynamic_cast<cmInstallTargetGenerator*>(installGenerator); + dynamic_cast<cmInstallTargetGenerator*>(installGenerator.get()); if (installTargetGenerator != nullptr && installTargetGenerator->GetTarget()->Target == target->Target) { auto dest = installTargetGenerator->GetDestination(config); @@ -643,9 +643,9 @@ static Json::Value DumpProjectList(const cmake* cm, std::string const& config) // associated generators. bool hasInstallRule = false; for (const auto generator : projectIt.second) { - for (const auto installGen : + for (const auto& installGen : generator->GetMakefile()->GetInstallGenerators()) { - if (!dynamic_cast<cmInstallSubdirectoryGenerator*>(installGen)) { + if (!dynamic_cast<cmInstallSubdirectoryGenerator*>(installGen.get())) { hasInstallRule = true; break; } |