forked from qt-creator/qt-creator
CMake: Trigger cmake run *before* build when files changed
Make sure to run cmake *before* cmake --build when cmake files just got saved. This helps e.g. when editing CMakeLists.txt files and the hitting "Built" and "Save all" (or "Always save before build"). Task-number: QTCREATORBUG-16187 Change-Id: I16b1d02eb342a447003380946ce7a9d785476a0e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -235,9 +235,18 @@ void CMakeBuildStep::run(QFutureInterface<bool> &fi)
|
||||
bc = qobject_cast<CMakeBuildConfiguration *>(target()->activeBuildConfiguration());
|
||||
QTC_ASSERT(bc, return);
|
||||
|
||||
bool mustDelay = false;
|
||||
if (bc->persistCMakeState()) {
|
||||
emit addOutput(tr("Persisting CMake state..."), BuildStep::MessageOutput);
|
||||
mustDelay = true;
|
||||
} else if (bc->updateCMakeStateBeforeBuild()) {
|
||||
emit addOutput(tr("Running CMake in preparation to build..."), BuildStep::MessageOutput);
|
||||
mustDelay = true;
|
||||
} else {
|
||||
mustDelay = false;
|
||||
}
|
||||
|
||||
if (mustDelay) {
|
||||
m_runTrigger = connect(bc, &CMakeBuildConfiguration::dataAvailable,
|
||||
this, [this, &fi]() { runImpl(fi); });
|
||||
m_errorTrigger = connect(bc, &CMakeBuildConfiguration::errorOccured,
|
||||
|
||||
Reference in New Issue
Block a user