ClangTools: Hint to "Build the project before starting" option

...if the analysis ends with errors.

Task-number: QTCREATORBUG-22382
Change-Id: I59f99947e80f7f4d0e2cac4df2e00f68e385ee01
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-06-19 16:11:54 +02:00
parent e6ede1d997
commit 83bf414c85

View File

@@ -477,6 +477,16 @@ void ClangToolRunControl::finalize()
if (m_filesNotAnalyzed != 0) {
QString msg = tr("%1: Not all files could be analyzed.").arg(toolName);
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
if (m_target && !m_target->activeBuildConfiguration()->buildDirectory().exists()
&& !ClangToolsProjectSettingsManager::getSettings(m_target->project())
->buildBeforeAnalysis()) {
msg = tr("%1: You might need to build the project to generate or update source "
"files. To build automatically, enable \"Build the project before starting "
"analysis\".")
.arg(toolName);
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
}
TaskHub::requestPopup();
}