summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.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/cmMakefileTargetGenerator.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/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 97e3fad..02cdf57 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -967,8 +967,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
bool const lang_has_assembly = lang_has_preprocessor;
bool const lang_can_export_cmds = lang_has_preprocessor;
- std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
- this->LocalGenerator->CreateRulePlaceholderExpander());
+ auto rulePlaceholderExpander =
+ this->LocalGenerator->CreateRulePlaceholderExpander();
// Construct the compile rules.
{
@@ -1789,8 +1789,7 @@ void cmMakefileTargetGenerator::WriteDeviceLinkRule(
vars.Flags = flags.c_str();
std::string compileCmd = this->GetLinkRule("CMAKE_CUDA_DEVICE_LINK_COMPILE");
- std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
- localGen->CreateRulePlaceholderExpander());
+ auto rulePlaceholderExpander = localGen->CreateRulePlaceholderExpander();
rulePlaceholderExpander->ExpandRuleVariables(localGen, compileCmd, vars);
commands.emplace_back(compileCmd);