From 2ef2e497fc7a0f91db91d6d6a3a2cc3db03363ad Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 1 Jun 2021 16:58:19 +0200 Subject: [PATCH] CMakePM: Cancel active C/C++ parsing before starting CMake If CMake is being triggered when C/C++ parsing is running, make sure to cancel() the C/C++ parsing before running CMake. The C/C++ parsing is issued after the CMake project is loaded, so for a subsequent CMake run there is no need to have the system busy with C/C++ parsing and at the same time run CMake. Change-Id: Ib9a2e057a90d9572e904ff449666bb9b12d1accc Reviewed-by: David Schulz Reviewed-by: Eike Ziller --- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 560b9251ae2..94eeb5032e1 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -296,6 +296,10 @@ void CMakeBuildSystem::triggerParsing() reparseParameters |= REPARSE_FORCE_CMAKE_RUN | REPARSE_FORCE_EXTRA_CONFIGURATION; } + // The code model will be updated after the CMake run. There is no need to have an + // active code model updater when the next one will be triggered. + m_cppCodeModelUpdater->cancel(); + qCDebug(cmakeBuildSystemLog) << "Asking reader to parse"; m_reader.parse(reparseParameters & REPARSE_FORCE_CMAKE_RUN, reparseParameters & REPARSE_FORCE_INITIAL_CONFIGURATION,