diff options
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 8ca6ee6..4cfec22 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> @@ -947,7 +949,7 @@ void cmGlobalGenerator::PrintCompilerAdvice(std::ostream& os, // Subclasses override this method if they do not support this advice. os << "Tell CMake where to find the compiler by setting "; if (envVar) { - os << "either the environment variable \"" << envVar << "\" or "; + os << "either the environment variable \"" << *envVar << "\" or "; } os << "the CMake cache entry CMAKE_" << lang << "_COMPILER " @@ -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,20 +1354,17 @@ 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()) { msg << "Configuring incomplete, errors occurred!"; - const char* logs[] = { "CMakeOutput.log", "CMakeError.log", nullptr }; - for (const char** log = logs; *log; ++log) { - std::string f = cmStrCat(this->CMakeInstance->GetHomeOutputDirectory(), - "/CMakeFiles/", *log); - if (cmSystemTools::FileExists(f)) { - msg << "\nSee also \"" << f << "\"."; - } - } } 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 +1607,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 +1691,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() @@ -2040,7 +2049,7 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir, cmBuildOptions defaultBuildOptions(false, fast, PackageResolveMode::Disable); return this->Build(jobs, srcdir, bindir, projectName, newTarget, output, "", - config, defaultBuildOptions, false, + config, defaultBuildOptions, true, this->TryCompileTimeout); } |