summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-01-17 21:11:46 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-01-19 14:51:07 (GMT)
commit5f0c5ec49b553cbe4482d9a8cf7e8889dc90e759 (patch)
tree042aab69ad69e49171eb7aef5431a3c87b66f9ff /Source/cmGlobalGenerator.cxx
parent43c4faaf48220df719b8e2428ee0fcb8886169d3 (diff)
downloadCMake-5f0c5ec49b553cbe4482d9a8cf7e8889dc90e759.zip
CMake-5f0c5ec49b553cbe4482d9a8cf7e8889dc90e759.tar.gz
CMake-5f0c5ec49b553cbe4482d9a8cf7e8889dc90e759.tar.bz2
cmake: Print configure/generate time
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 8ca6ee6..f000a28 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()