summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index db72353..52bb046 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -7,6 +7,7 @@
#include <sstream>
#include <utility>
+#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
@@ -215,7 +216,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
// Just depend on the all target to drive the build.
std::vector<std::string> depends;
std::vector<std::string> no_commands;
- depends.push_back("all");
+ depends.emplace_back("all");
// Write the rule.
lg->WriteMakeRule(makefileStream,
@@ -494,6 +495,7 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
const std::string& targetName, const std::string& /*config*/, bool fast,
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
{
+ std::unique_ptr<cmMakefile> mfu;
cmMakefile* mf;
if (!this->Makefiles.empty()) {
mf = this->Makefiles[0];
@@ -504,13 +506,14 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
snapshot.GetDirectory().SetCurrentBinary(
this->CMakeInstance->GetHomeOutputDirectory());
snapshot.SetDefaultDefinitions();
- mf = new cmMakefile(this, snapshot);
+ mfu = cm::make_unique<cmMakefile>(this, snapshot);
+ mf = mfu.get();
}
makeCommand.push_back(this->SelectMakeProgram(makeProgram));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back("-j");
+ makeCommand.emplace_back("-j");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
makeCommand.push_back(std::to_string(jobs));
}
@@ -529,9 +532,6 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.push_back(std::move(tname));
}
- if (this->Makefiles.empty()) {
- delete mf;
- }
}
void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
@@ -542,7 +542,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
bool regenerate = !this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION");
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
// write the target convenience rules
@@ -577,7 +577,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
commands.push_back(lg->GetRecursiveMakeCall(tmp.c_str(), name));
depends.clear();
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
lg->WriteMakeRule(ruleFileStream, "Build rule for target.", name,
depends, commands, true);
@@ -631,7 +631,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
bool regenerate = !this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION");
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
// for each target Generate the rule files for each target.
@@ -740,7 +740,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
}
depends.clear();
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
localName = lg->GetRelativeTargetDirectory(gtarget);
localName += "/rule";