summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/dev/print-configure-generate-time.rst8
-rw-r--r--Source/cmGlobalGenerator.cxx29
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx5
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h6
-rw-r--r--Source/cmake.cxx27
5 files changed, 35 insertions, 40 deletions
diff --git a/Help/release/dev/print-configure-generate-time.rst b/Help/release/dev/print-configure-generate-time.rst
new file mode 100644
index 0000000..098ca6e
--- /dev/null
+++ b/Help/release/dev/print-configure-generate-time.rst
@@ -0,0 +1,8 @@
+print-configure-generate-time
+-----------------------------
+
+* The durations printed after "Configuring done" and "Generating done"
+ messages now reflect time spent in generator-specific steps, and
+ in a code model evaluation step at the beginning of generation that
+ was not previously captured. Printed durations may appear longer
+ than in previous versions of CMake.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index e397fa2..8681640 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -4,13 +4,11 @@
#include <algorithm>
#include <cassert>
-#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <initializer_list>
-#include <iomanip>
#include <iterator>
#include <sstream>
#include <type_traits>
@@ -1351,8 +1349,6 @@ void cmGlobalGenerator::CreateLocalGenerators()
void cmGlobalGenerator::Configure()
{
- auto startTime = std::chrono::steady_clock::now();
-
this->FirstTimeProgress = 0.0f;
this->ClearGeneratorMembers();
this->NextDeferId = 0;
@@ -1407,21 +1403,6 @@ void cmGlobalGenerator::Configure()
this->GetCMakeInstance()->AddCacheEntry(
"CMAKE_NUMBER_OF_MAKEFILES", std::to_string(this->Makefiles.size()),
"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()) {
- msg << "Configuring incomplete, errors occurred!";
- } else {
- 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);
- }
}
void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
@@ -1683,8 +1664,6 @@ 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();
@@ -1775,14 +1754,6 @@ void cmGlobalGenerator::Generate()
this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
w.str());
}
-
- 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()
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 0d357ad..b1fba8f 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -225,11 +225,6 @@ std::string cmGlobalVisualStudio8Generator::GetGenerateStampList()
return "generate.stamp.list";
}
-void cmGlobalVisualStudio8Generator::Configure()
-{
- this->cmGlobalVisualStudio7Generator::Configure();
-}
-
bool cmGlobalVisualStudio8Generator::UseFolderProperty() const
{
// NOLINTNEXTLINE(bugprone-parent-virtual-call)
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index cb0ea76..931de40 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -40,12 +40,6 @@ public:
cm::optional<std::string> const& GetTargetFrameworkIdentifier() const;
cm::optional<std::string> const& GetTargetFrameworkTargetsVersion() const;
- /**
- * Override Configure and Generate to add the build-system check
- * target.
- */
- void Configure() override;
-
/** Return true if the target project file should have the option
LinkLibraryDependencies and link to .sln dependencies. */
bool NeedLinkLibraryDependencies(cmGeneratorTarget* target) override;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2d09e74..775265f 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -4,10 +4,12 @@
#include <algorithm>
#include <array>
+#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <initializer_list>
+#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdexcept>
@@ -2557,7 +2559,22 @@ int cmake::ActualConfigure()
#endif
// actually do the configure
+ auto startTime = std::chrono::steady_clock::now();
this->GlobalGenerator->Configure();
+ auto endTime = std::chrono::steady_clock::now();
+
+ if (this->GetWorkingMode() == cmake::NORMAL_MODE) {
+ std::ostringstream msg;
+ if (cmSystemTools::GetErrorOccurredFlag()) {
+ msg << "Configuring incomplete, errors occurred!";
+ } else {
+ 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->UpdateProgress(msg.str(), -1);
+ }
#if !defined(CMAKE_BOOTSTRAP)
this->ConfigureLog.reset();
@@ -2889,10 +2906,20 @@ int cmake::Generate()
auto profilingRAII = this->CreateProfilingEntry("project", "generate");
#endif
+ auto startTime = std::chrono::steady_clock::now();
if (!this->GlobalGenerator->Compute()) {
return -1;
}
this->GlobalGenerator->Generate();
+ 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->UpdateProgress(msg.str(), -1);
+ }
if (!this->GraphVizFile.empty()) {
std::cout << "Generate graphviz: " << this->GraphVizFile << '\n';
this->GenerateGraphViz(this->GraphVizFile);