mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-21 23:00:50 +08:00
instrumentation: Use auto for variables holding closures
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <functional>
|
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -2725,7 +2724,7 @@ int cmCTest::ExecuteTests(std::vector<std::string> const& args)
|
|||||||
handler.SetVerbose(this->Impl->Verbose);
|
handler.SetVerbose(this->Impl->Verbose);
|
||||||
|
|
||||||
cmInstrumentation instrumentation(this->GetBinaryDir());
|
cmInstrumentation instrumentation(this->GetBinaryDir());
|
||||||
std::function<int()> processHandler = [&handler]() {
|
auto processHandler = [&handler]() -> int {
|
||||||
return handler.ProcessHandler();
|
return handler.ProcessHandler();
|
||||||
};
|
};
|
||||||
int ret = instrumentation.InstrumentCommand("ctest", args, processHandler);
|
int ret = instrumentation.InstrumentCommand("ctest", args, processHandler);
|
||||||
|
@@ -2624,7 +2624,7 @@ int cmake::ActualConfigure()
|
|||||||
cmSystemTools::Error(this->Instrumentation->errorMsg);
|
cmSystemTools::Error(this->Instrumentation->errorMsg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
std::function<int()> doConfigure = [this]() -> int {
|
auto doConfigure = [this]() -> int {
|
||||||
this->GlobalGenerator->Configure();
|
this->GlobalGenerator->Configure();
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@@ -3023,7 +3023,7 @@ int cmake::Generate()
|
|||||||
auto startTime = std::chrono::steady_clock::now();
|
auto startTime = std::chrono::steady_clock::now();
|
||||||
#if !defined(CMAKE_BOOTSTRAP)
|
#if !defined(CMAKE_BOOTSTRAP)
|
||||||
auto profilingRAII = this->CreateProfilingEntry("project", "generate");
|
auto profilingRAII = this->CreateProfilingEntry("project", "generate");
|
||||||
std::function<int()> doGenerate = [this]() -> int {
|
auto doGenerate = [this]() -> int {
|
||||||
if (!this->GlobalGenerator->Compute()) {
|
if (!this->GlobalGenerator->Compute()) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -3975,9 +3975,8 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
|
|||||||
// are being executed to the `output` parameter. If CMake is verbose, print
|
// are being executed to the `output` parameter. If CMake is verbose, print
|
||||||
// this out.
|
// this out.
|
||||||
std::ostream& verbose_ostr = verbose ? std::cout : ostr;
|
std::ostream& verbose_ostr = verbose ? std::cout : ostr;
|
||||||
std::function<int()> doBuild = [this, jobs, dir, projName, targets,
|
auto doBuild = [this, jobs, dir, projName, targets, &verbose_ostr, config,
|
||||||
&verbose_ostr, config, buildOptions, verbose,
|
buildOptions, verbose, nativeOptions]() -> int {
|
||||||
nativeOptions]() {
|
|
||||||
return this->GlobalGenerator->Build(
|
return this->GlobalGenerator->Build(
|
||||||
jobs, "", dir, projName, targets, verbose_ostr, "", config, buildOptions,
|
jobs, "", dir, projName, targets, verbose_ostr, "", config, buildOptions,
|
||||||
verbose, cmDuration::zero(), cmSystemTools::OUTPUT_PASSTHROUGH,
|
verbose, cmDuration::zero(), cmSystemTools::OUTPUT_PASSTHROUGH,
|
||||||
|
@@ -971,8 +971,7 @@ int do_install(int ac, char const* const* av)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::function<int()> doInstall = [&handler, &verbose, &jobs,
|
auto doInstall = [&handler, &verbose, &jobs, &instrumentation]() -> int {
|
||||||
&instrumentation]() -> int {
|
|
||||||
int ret_ = 0;
|
int ret_ = 0;
|
||||||
if (handler.IsParallel()) {
|
if (handler.IsParallel()) {
|
||||||
ret_ = handler.Install(jobs, instrumentation);
|
ret_ = handler.Install(jobs, instrumentation);
|
||||||
|
Reference in New Issue
Block a user