From a8b96a824002ecf6161fdc840fa2e51e78f2c5ab Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 6 Dec 2019 11:29:36 +0100 Subject: [PATCH] CMake: More logging of parsing starting/stopped Change-Id: I52dad9260c21e03add513f7229148635ae76236a Reviewed-by: Cristian Adam --- src/plugins/cmakeprojectmanager/builddirmanager.cpp | 1 + .../cmakeprojectmanager/cmakebuildsystem.cpp | 13 +++++++++++++ .../cmakeprojectmanager/cmakeprojectmanager.cpp | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.cpp b/src/plugins/cmakeprojectmanager/builddirmanager.cpp index e5af6025f6f..ed33f9d97f0 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.cpp +++ b/src/plugins/cmakeprojectmanager/builddirmanager.cpp @@ -338,6 +338,7 @@ bool BuildDirManager::persistCMakeState() BuildDirParameters newParameters = m_parameters; newParameters.workDirectory.clear(); + qCDebug(cmakeBuildDirManagerLog) << "Requesting parse due to persisting CMake State"; setParametersAndRequestParse(newParameters, REPARSE_URGENT | REPARSE_FORCE_CMAKE_RUN | REPARSE_FORCE_CONFIGURATION | REPARSE_CHECK_CONFIGURATION); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 097c3aa1b78..f0dc48a851b 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -129,6 +129,7 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) return; // not for us... // Build configuration has not changed, but Kit settings might have: // reparse and check the configuration, independent of whether the reader has changed + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to kit being updated"; m_buildDirManager.setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration), BuildDirManager::REPARSE_CHECK_CONFIGURATION); }); @@ -139,6 +140,7 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) // Build configuration has switched: // * Check configuration if reader changes due to it not existing yet:-) // * run cmake without configuration arguments if the reader stays + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to active target changed"; m_buildDirManager .setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration), BuildDirManager::REPARSE_CHECK_CONFIGURATION); @@ -152,6 +154,7 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) // Build configuration has switched: // * Check configuration if reader changes due to it not existing yet:-) // * run cmake without configuration arguments if the reader stays + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to active BC changed"; m_buildDirManager .setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration), BuildDirManager::REPARSE_CHECK_CONFIGURATION); @@ -167,6 +170,7 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) // The environment on our BC has changed: // * Error out if the reader updates, cannot happen since all BCs share a target/kit. // * run cmake without configuration arguments if the reader stays + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to environment change"; m_buildDirManager .setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration), BuildDirManager::REPARSE_CHECK_CONFIGURATION); @@ -179,6 +183,7 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) // * run cmake without configuration arguments if the reader stays // If no configuration exists, then the arguments will get added automatically by // the reader. + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to build directory change"; m_buildDirManager .setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration), BuildDirManager::REPARSE_CHECK_CONFIGURATION); @@ -189,6 +194,7 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) // The CMake configuration has changed on our BC: // * Error out if the reader updates, cannot happen since all BCs share a target/kit. // * run cmake with configuration arguments if the reader stays + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to cmake configuration change"; m_buildDirManager .setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration), BuildDirManager::REPARSE_FORCE_CONFIGURATION); @@ -197,12 +203,14 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc) connect(project(), &Project::projectFileIsDirty, this, [this]() { if (m_buildConfiguration->isActive()) { + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file"; m_buildDirManager .setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration), BuildDirManager::REPARSE_DEFAULT); } }); + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to initial CMake BuildSystem setup"; m_buildDirManager.setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration), BuildDirManager::REPARSE_CHECK_CONFIGURATION); } @@ -221,8 +229,11 @@ CMakeBuildSystem::~CMakeBuildSystem() void CMakeBuildSystem::triggerParsing() { + qCDebug(cmakeBuildSystemLog) << "Parsing has been triggered"; m_currentGuard = guardParsingRun(); + QTC_CHECK(m_currentGuard.guardsProject()); + if (m_allFiles.isEmpty()) m_buildDirManager.requestFilesystemScan(); @@ -279,6 +290,7 @@ QStringList CMakeBuildSystem::filesGeneratedFrom(const QString &sourceFile) cons void CMakeBuildSystem::runCMake() { BuildDirParameters parameters(m_buildConfiguration); + qCDebug(cmakeBuildSystemLog) << "Requesting parse due \"Run CMake\" command"; m_buildDirManager.setParametersAndRequestParse(parameters, BuildDirManager::REPARSE_CHECK_CONFIGURATION | BuildDirManager::REPARSE_FORCE_CMAKE_RUN @@ -288,6 +300,7 @@ void CMakeBuildSystem::runCMake() void CMakeBuildSystem::runCMakeAndScanProjectTree() { BuildDirParameters parameters(m_buildConfiguration); + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to \"Rescan Project\" command"; m_buildDirManager.setParametersAndRequestParse(parameters, BuildDirManager::REPARSE_CHECK_CONFIGURATION | BuildDirManager::REPARSE_SCAN); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index be27ebb4f17..104c3c9bbc5 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -157,7 +157,7 @@ void CMakeManager::clearCMakeCache(BuildSystem *buildSystem) void CMakeManager::runCMake(BuildSystem *buildSystem) { auto cmakeBuildSystem = dynamic_cast(buildSystem); - QTC_ASSERT(cmakeBuildSystem, return); + QTC_ASSERT(cmakeBuildSystem, return ); if (ProjectExplorerPlugin::saveModifiedFiles()) cmakeBuildSystem->runCMake();