summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2023-10-25 15:04:07 (GMT)
committerBrad King <brad.king@kitware.com>2023-10-26 13:24:54 (GMT)
commit07e973479044b2f42d8c5bea0bd6057110fb4c4c (patch)
treeb696cbd4ef19eb213413f8faafe730304f6afe62 /Source
parent35424aab2e35ae5e4e3762feae26a0c305c73b9d (diff)
downloadCMake-07e973479044b2f42d8c5bea0bd6057110fb4c4c.zip
CMake-07e973479044b2f42d8c5bea0bd6057110fb4c4c.tar.gz
CMake-07e973479044b2f42d8c5bea0bd6057110fb4c4c.tar.bz2
Source: Fix clang -Wdeprecated-this-capture warnings
Explicitly capture variables used in the lambda.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 40d769d..9ed422d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1215,8 +1215,8 @@ cmTarget* cmMakefile::AddCustomCommandToTarget(
// Dispatch command creation to allow generator expressions in outputs.
this->AddGeneratorAction(
std::move(cc),
- [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
- std::unique_ptr<cmCustomCommand> tcc) {
+ [this, t, type](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+ std::unique_ptr<cmCustomCommand> tcc) {
BacktraceGuard guard(this->Backtrace, lfbt);
tcc->SetBacktrace(lfbt);
detail::AddCustomCommandToTarget(lg, cmCommandOrigin::Project, t, type,
@@ -1254,8 +1254,9 @@ void cmMakefile::AddCustomCommandToOutput(
// Dispatch command creation to allow generator expressions in outputs.
this->AddGeneratorAction(
std::move(cc),
- [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
- std::unique_ptr<cmCustomCommand> tcc) {
+ [this, replace, callback](cmLocalGenerator& lg,
+ const cmListFileBacktrace& lfbt,
+ std::unique_ptr<cmCustomCommand> tcc) {
BacktraceGuard guard(this->Backtrace, lfbt);
tcc->SetBacktrace(lfbt);
cmSourceFile* sf = detail::AddCustomCommandToOutput(
@@ -1341,7 +1342,8 @@ void cmMakefile::AppendCustomCommandToOutput(
if (this->ValidateCustomCommand(commandLines)) {
// Dispatch command creation to allow generator expressions in outputs.
this->AddGeneratorAction(
- [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
+ [this, output, depends, implicit_depends,
+ commandLines](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
BacktraceGuard guard(this->Backtrace, lfbt);
detail::AppendCustomCommandToOutput(lg, lfbt, output, depends,
implicit_depends, commandLines);
@@ -1372,8 +1374,8 @@ cmTarget* cmMakefile::AddUtilityCommand(const std::string& utilityName,
// Dispatch command creation to allow generator expressions in outputs.
this->AddGeneratorAction(
std::move(cc),
- [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
- std::unique_ptr<cmCustomCommand> tcc) {
+ [this, target](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+ std::unique_ptr<cmCustomCommand> tcc) {
BacktraceGuard guard(this->Backtrace, lfbt);
tcc->SetBacktrace(lfbt);
detail::AddUtilityCommand(lg, cmCommandOrigin::Project, target,