diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-11-07 17:52:06 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2019-11-11 15:41:13 (GMT) |
commit | f93385283fc86639c0a13b920c66c3a8f42276bb (patch) | |
tree | 7fa219d170720581d6d8438d0be6a1162e0c3b51 /Source/cmExtraCodeLiteGenerator.cxx | |
parent | 101b5288ffa988b86fc1fe83f3ff65c9694b1484 (diff) | |
download | CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.zip CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.tar.gz CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.tar.bz2 |
cmLocalGenerator: modernize memory management
Diffstat (limited to 'Source/cmExtraCodeLiteGenerator.cxx')
-rw-r--r-- | Source/cmExtraCodeLiteGenerator.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index c7b7457..269e8dd 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -4,6 +4,7 @@ #include <cstring> #include <map> +#include <memory> #include <set> #include <sstream> #include <utility> @@ -119,7 +120,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget( const std::vector<cmLocalGenerator*>& lgs = this->GlobalGenerator->GetLocalGenerators(); for (cmLocalGenerator* lg : lgs) { - for (cmGeneratorTarget* lt : lg->GetGeneratorTargets()) { + for (const auto& lt : lg->GetGeneratorTargets()) { cmStateEnums::TargetType type = lt->GetType(); std::string const& outputDir = lg->GetCurrentBinaryDirectory(); std::string targetName = lt->GetName(); @@ -142,7 +143,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget( xml->Attribute("Active", "No"); xml->EndElement(); - CreateNewProjectFile(lt, filename); + CreateNewProjectFile(lt.get(), filename); break; default: break; @@ -269,9 +270,9 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile( for (cmLocalGenerator* lg : lgs) { cmMakefile* makefile = lg->GetMakefile(); - const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { - projectType = CollectSourceFiles(makefile, target, cFiles, otherFiles); + for (const auto& target : lg->GetGeneratorTargets()) { + projectType = + CollectSourceFiles(makefile, target.get(), cFiles, otherFiles); } } |