diff options
author | Cristian Adam <[email protected]> | 2020-02-20 11:20:32 +0100 |
---|---|---|
committer | Tobias Hunger <[email protected]> | 2020-02-20 15:41:28 +0000 |
commit | f65f260c917e7b6034880aab3c8f216e6ab4a41e (patch) | |
tree | 1aaf24eb02b3647439728ed855d34fd8fcfdebe1 /src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | |
parent | 65e244b2381fb3945efb838cf85c51aa4cfe2141 (diff) |
CMakeBuildSystem: Don't re-update code model on CMakeLists.txt saves
Currently if you edit a CMakeLists.txt and then press save, the code
model will be reindexed.
On projects like Qt Creator this operation is quite significant.
Note that the code model is updated after CMake has run on the project,
which is what I would expect.
Saving the CMakeLists.txt and not running CMake has no effect on the
project, and the code model shoudn't be reindexed.
Change-Id: I61289fda60752ef002cf3625d339d4fcaf144d1b
Reviewed-by: Cristian Adam <[email protected]>
Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 9f175a635fb..3d9d4808c5a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -26,6 +26,7 @@ #include "cmakebuildsystem.h" #include "cmakebuildconfiguration.h" +#include "cmakekitinformation.h" #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmakeprojectnodes.h" @@ -204,10 +205,13 @@ 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); + const auto cmake = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit()); + if (cmake && cmake->isAutoRun()) { + qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file"; + m_buildDirManager.setParametersAndRequestParse(BuildDirParameters( + m_buildConfiguration), + BuildDirManager::REPARSE_DEFAULT); + } } }); |