From f106df8f96011492c892ed007602c3efe7148efa Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 May 2024 14:20:52 -0400 Subject: cmGlobalVisualStudio8Generator: Remove unused Configure method override It has not been needed since commit c85367f408 (VS: Compute project GUIDs deterministically, 2015-06-02, v3.4.0-rc1~496^2) --- Source/cmGlobalVisualStudio8Generator.cxx | 5 ----- Source/cmGlobalVisualStudio8Generator.h | 6 ------ 2 files changed, 11 deletions(-) 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 const& GetTargetFrameworkIdentifier() const; cm::optional 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; -- cgit v0.12 From 29404cfd9211b24adb1f82bafbb9f211baed8411 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 May 2024 14:42:43 -0400 Subject: cmake: Capture more complete configure/generate steps in printed durations Extend the start/end times from commit 5f0c5ec49b (cmake: Print configure/generate time, 2023-01-17, v3.26.0-rc1~67^2) to capture generator-specific Configure/Generate actions, and the time spent in the internal "Compute" step at the start of generation. Fixes: #25482 --- Help/release/dev/print-configure-generate-time.rst | 8 ++++++ Source/cmGlobalGenerator.cxx | 29 ---------------------- Source/cmake.cxx | 27 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 29 deletions(-) create mode 100644 Help/release/dev/print-configure-generate-time.rst 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 #include -#include #include #include #include #include #include -#include #include #include #include @@ -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( - 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(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/cmake.cxx b/Source/cmake.cxx index 2d09e74..775265f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -4,10 +4,12 @@ #include #include +#include #include #include #include #include +#include #include #include #include @@ -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( + 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(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); -- cgit v0.12