cmMakefile: modernize memory management

This commit is contained in:
Marc Chevrier
2020-01-12 16:58:54 +01:00
parent 2d5e9f3d8c
commit f466cea3c9
16 changed files with 177 additions and 168 deletions
+3 -4
View File
@@ -3,6 +3,7 @@
#include "cmTargetLinkLibrariesCommand.h"
#include <cstring>
#include <memory>
#include <sstream>
#include "cmExecutionStatus.h"
@@ -64,11 +65,9 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
cmTarget* target =
mf.GetCMakeInstance()->GetGlobalGenerator()->FindTarget(args[0]);
if (!target) {
const std::vector<cmTarget*>& importedTargets =
mf.GetOwnedImportedTargets();
for (cmTarget* importedTarget : importedTargets) {
for (const auto& importedTarget : mf.GetOwnedImportedTargets()) {
if (importedTarget->GetName() == args[0]) {
target = importedTarget;
target = importedTarget.get();
break;
}
}