CMake: Allow cancellation of CMake process

Allow cancellation of cmake runs in tea-leaf and fileapi modes.

At least in those modes cmake can now get stopped when it goes into
an infinite loop.

Change-Id: I4e9bd769292325b9837904cd391ff61dbc477898
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2019-06-14 16:42:41 +02:00
parent fa57e933a9
commit 97392daaf3
2 changed files with 36 additions and 5 deletions

View File

@@ -32,6 +32,7 @@
#include <utils/qtcprocess.h>
#include <QFutureInterface>
#include <QTimer>
#include <memory>
@@ -67,10 +68,13 @@ signals:
private:
void handleProcessFinished(int code, QProcess::ExitStatus status);
void checkForCancelled();
std::unique_ptr<Utils::QtcProcess> m_process;
std::unique_ptr<ProjectExplorer::IOutputParser> m_parser;
std::unique_ptr<QFutureInterface<void>> m_future;
bool m_processWasCanceled = false;
QTimer m_cancelTimer;
};
} // namespace Internal