mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-07 08:10:48 +00:00
Source: Fix clang -Wdeprecated-this-capture warnings
Explicitly capture variables used in the lambda.
This commit is contained in:
@@ -1215,8 +1215,8 @@ cmTarget* cmMakefile::AddCustomCommandToTarget(
|
|||||||
// Dispatch command creation to allow generator expressions in outputs.
|
// Dispatch command creation to allow generator expressions in outputs.
|
||||||
this->AddGeneratorAction(
|
this->AddGeneratorAction(
|
||||||
std::move(cc),
|
std::move(cc),
|
||||||
[=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
|
[this, t, type](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
|
||||||
std::unique_ptr<cmCustomCommand> tcc) {
|
std::unique_ptr<cmCustomCommand> tcc) {
|
||||||
BacktraceGuard guard(this->Backtrace, lfbt);
|
BacktraceGuard guard(this->Backtrace, lfbt);
|
||||||
tcc->SetBacktrace(lfbt);
|
tcc->SetBacktrace(lfbt);
|
||||||
detail::AddCustomCommandToTarget(lg, cmCommandOrigin::Project, t, type,
|
detail::AddCustomCommandToTarget(lg, cmCommandOrigin::Project, t, type,
|
||||||
@@ -1254,8 +1254,9 @@ void cmMakefile::AddCustomCommandToOutput(
|
|||||||
// Dispatch command creation to allow generator expressions in outputs.
|
// Dispatch command creation to allow generator expressions in outputs.
|
||||||
this->AddGeneratorAction(
|
this->AddGeneratorAction(
|
||||||
std::move(cc),
|
std::move(cc),
|
||||||
[=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
|
[this, replace, callback](cmLocalGenerator& lg,
|
||||||
std::unique_ptr<cmCustomCommand> tcc) {
|
const cmListFileBacktrace& lfbt,
|
||||||
|
std::unique_ptr<cmCustomCommand> tcc) {
|
||||||
BacktraceGuard guard(this->Backtrace, lfbt);
|
BacktraceGuard guard(this->Backtrace, lfbt);
|
||||||
tcc->SetBacktrace(lfbt);
|
tcc->SetBacktrace(lfbt);
|
||||||
cmSourceFile* sf = detail::AddCustomCommandToOutput(
|
cmSourceFile* sf = detail::AddCustomCommandToOutput(
|
||||||
@@ -1341,7 +1342,8 @@ void cmMakefile::AppendCustomCommandToOutput(
|
|||||||
if (this->ValidateCustomCommand(commandLines)) {
|
if (this->ValidateCustomCommand(commandLines)) {
|
||||||
// Dispatch command creation to allow generator expressions in outputs.
|
// Dispatch command creation to allow generator expressions in outputs.
|
||||||
this->AddGeneratorAction(
|
this->AddGeneratorAction(
|
||||||
[=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
|
[this, output, depends, implicit_depends,
|
||||||
|
commandLines](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
|
||||||
BacktraceGuard guard(this->Backtrace, lfbt);
|
BacktraceGuard guard(this->Backtrace, lfbt);
|
||||||
detail::AppendCustomCommandToOutput(lg, lfbt, output, depends,
|
detail::AppendCustomCommandToOutput(lg, lfbt, output, depends,
|
||||||
implicit_depends, commandLines);
|
implicit_depends, commandLines);
|
||||||
@@ -1372,8 +1374,8 @@ cmTarget* cmMakefile::AddUtilityCommand(const std::string& utilityName,
|
|||||||
// Dispatch command creation to allow generator expressions in outputs.
|
// Dispatch command creation to allow generator expressions in outputs.
|
||||||
this->AddGeneratorAction(
|
this->AddGeneratorAction(
|
||||||
std::move(cc),
|
std::move(cc),
|
||||||
[=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
|
[this, target](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
|
||||||
std::unique_ptr<cmCustomCommand> tcc) {
|
std::unique_ptr<cmCustomCommand> tcc) {
|
||||||
BacktraceGuard guard(this->Backtrace, lfbt);
|
BacktraceGuard guard(this->Backtrace, lfbt);
|
||||||
tcc->SetBacktrace(lfbt);
|
tcc->SetBacktrace(lfbt);
|
||||||
detail::AddUtilityCommand(lg, cmCommandOrigin::Project, target,
|
detail::AddUtilityCommand(lg, cmCommandOrigin::Project, target,
|
||||||
|
|||||||
Reference in New Issue
Block a user