diff options
author | Brad King <brad.king@kitware.com> | 2023-01-20 14:32:35 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-01-20 14:32:45 (GMT) |
commit | 526b2db5d3be2a04bc3176d0ecad9da91ced103a (patch) | |
tree | 89ab305137f7823b3e510c79e7e5e54a6825b604 /Source/cmGlobalGenerator.cxx | |
parent | dde39a820e47deae35fecb62d2350d484b1a6f91 (diff) | |
parent | 5f0c5ec49b553cbe4482d9a8cf7e8889dc90e759 (diff) | |
download | CMake-526b2db5d3be2a04bc3176d0ecad9da91ced103a.zip CMake-526b2db5d3be2a04bc3176d0ecad9da91ced103a.tar.gz CMake-526b2db5d3be2a04bc3176d0ecad9da91ced103a.tar.bz2 |
Merge topic 'print-configure-generate-time'
5f0c5ec49b cmake: Print configure/generate time
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8083
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 40234b1..ed99dd7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -4,11 +4,13 @@ #include <algorithm> #include <cassert> +#include <chrono> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <initializer_list> +#include <iomanip> #include <iterator> #include <sstream> #include <utility> @@ -1303,6 +1305,8 @@ void cmGlobalGenerator::CreateLocalGenerators() void cmGlobalGenerator::Configure() { + auto startTime = std::chrono::steady_clock::now(); + this->FirstTimeProgress = 0.0f; this->ClearGeneratorMembers(); this->NextDeferId = 0; @@ -1350,6 +1354,8 @@ void cmGlobalGenerator::Configure() "number of local generators", cmStateEnums::INTERNAL); + auto endTime = std::chrono::steady_clock::now(); + if (this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE) { std::ostringstream msg; if (cmSystemTools::GetErrorOccurredFlag()) { @@ -1363,7 +1369,10 @@ void cmGlobalGenerator::Configure() } } } else { - msg << "Configuring done"; + auto ms = std::chrono::duration_cast<std::chrono::milliseconds>( + endTime - startTime); + msg << "Configuring done (" << std::fixed << std::setprecision(1) + << ms.count() / 1000.0L << "s)"; } this->CMakeInstance->UpdateProgress(msg.str(), -1); } @@ -1606,6 +1615,8 @@ bool cmGlobalGenerator::Compute() void cmGlobalGenerator::Generate() { + auto startTime = std::chrono::steady_clock::now(); + // Create a map from local generator to the complete set of targets // it builds by default. this->InitializeProgressMarks(); @@ -1688,7 +1699,13 @@ void cmGlobalGenerator::Generate() w.str()); } - this->CMakeInstance->UpdateProgress("Generating done", -1); + auto endTime = std::chrono::steady_clock::now(); + auto ms = + std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime); + std::ostringstream msg; + msg << "Generating done (" << std::fixed << std::setprecision(1) + << ms.count() / 1000.0L << "s)"; + this->CMakeInstance->UpdateProgress(msg.str(), -1); } bool cmGlobalGenerator::ComputeTargetDepends() |