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

View File

@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddTestCommand.h"
#include <cm/memory>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
@@ -44,7 +46,7 @@ bool cmAddTestCommand(std::vector<std::string> const& args,
} else {
test = mf.CreateTest(args[0]);
test->SetOldStyle(true);
mf.AddTestGenerator(new cmTestGenerator(test));
mf.AddTestGenerator(cm::make_unique<cmTestGenerator>(test));
}
test->SetCommand(command);
@@ -141,7 +143,7 @@ bool cmAddTestCommandHandleNameMode(std::vector<std::string> const& args,
test->SetProperty("WORKING_DIRECTORY", working_directory.c_str());
}
test->SetCommandExpandLists(command_expand_lists);
mf.AddTestGenerator(new cmTestGenerator(test, configurations));
mf.AddTestGenerator(cm::make_unique<cmTestGenerator>(test, configurations));
return true;
}