summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-05-01 17:12:46 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-05-04 17:34:36 (GMT)
commit72faa9a0175f7651c2707fead6a41450d2aaec88 (patch)
treee62fa3432742f1c62d1d911544e4cf42ca4028bd /Source/cmLocalNinjaGenerator.cxx
parent0d2d5a229c1cda842f0e67134637f19fc69de6c6 (diff)
downloadCMake-72faa9a0175f7651c2707fead6a41450d2aaec88.zip
CMake-72faa9a0175f7651c2707fead6a41450d2aaec88.tar.gz
CMake-72faa9a0175f7651c2707fead6a41450d2aaec88.tar.bz2
CreateRulePlaceholderExpander(): enhance memory management
This method returns now a std::unique_ptr instance rather than a raw pointer.
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 82d5a60..4b0604c 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -47,13 +47,12 @@ cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg,
// Virtual public methods.
-cmRulePlaceholderExpander*
+std::unique_ptr<cmRulePlaceholderExpander>
cmLocalNinjaGenerator::CreateRulePlaceholderExpander() const
{
- cmRulePlaceholderExpander* ret =
- this->cmLocalGenerator::CreateRulePlaceholderExpander();
+ auto ret = this->cmLocalGenerator::CreateRulePlaceholderExpander();
ret->SetTargetImpLib("$TARGET_IMPLIB");
- return ret;
+ return std::unique_ptr<cmRulePlaceholderExpander>(std::move(ret));
}
cmLocalNinjaGenerator::~cmLocalNinjaGenerator() = default;
@@ -913,8 +912,7 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
}
vars.Output = output.c_str();
- std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
- this->CreateRulePlaceholderExpander());
+ auto rulePlaceholderExpander = this->CreateRulePlaceholderExpander();
std::string launcher = *property_value;
rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars);