diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 0b4aef8f13..2e0b07e142 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -2725,7 +2724,7 @@ int cmCTest::ExecuteTests(std::vector const& args) handler.SetVerbose(this->Impl->Verbose); cmInstrumentation instrumentation(this->GetBinaryDir()); - std::function processHandler = [&handler]() { + auto processHandler = [&handler]() -> int { return handler.ProcessHandler(); }; int ret = instrumentation.InstrumentCommand("ctest", args, processHandler); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index d525a5a4e9..0bee1cc3cc 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2624,7 +2624,7 @@ int cmake::ActualConfigure() cmSystemTools::Error(this->Instrumentation->errorMsg); return 1; } - std::function doConfigure = [this]() -> int { + auto doConfigure = [this]() -> int { this->GlobalGenerator->Configure(); return 0; }; @@ -3023,7 +3023,7 @@ int cmake::Generate() auto startTime = std::chrono::steady_clock::now(); #if !defined(CMAKE_BOOTSTRAP) auto profilingRAII = this->CreateProfilingEntry("project", "generate"); - std::function doGenerate = [this]() -> int { + auto doGenerate = [this]() -> int { if (!this->GlobalGenerator->Compute()) { return -1; } @@ -3975,9 +3975,8 @@ int cmake::Build(int jobs, std::string dir, std::vector targets, // are being executed to the `output` parameter. If CMake is verbose, print // this out. std::ostream& verbose_ostr = verbose ? std::cout : ostr; - std::function doBuild = [this, jobs, dir, projName, targets, - &verbose_ostr, config, buildOptions, verbose, - nativeOptions]() { + auto doBuild = [this, jobs, dir, projName, targets, &verbose_ostr, config, + buildOptions, verbose, nativeOptions]() -> int { return this->GlobalGenerator->Build( jobs, "", dir, projName, targets, verbose_ostr, "", config, buildOptions, verbose, cmDuration::zero(), cmSystemTools::OUTPUT_PASSTHROUGH, diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index cc55343fc5..60b59adf27 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -971,8 +971,7 @@ int do_install(int ac, char const* const* av) } } - std::function doInstall = [&handler, &verbose, &jobs, - &instrumentation]() -> int { + auto doInstall = [&handler, &verbose, &jobs, &instrumentation]() -> int { int ret_ = 0; if (handler.IsParallel()) { ret_ = handler.Install(jobs, instrumentation);