forked from qt-creator/qt-creator
ClangTools: Fix soft assert when no clang tool can be detected
When no clang include dir or version can be detected the runner does not contain a valid executable so skip that runner. Change-Id: Ia1b664b65ac4a9d80042d77dfb5b8842ec06dcea Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -218,11 +218,15 @@ void DocumentClangToolRunner::runNext()
|
|||||||
auto [clangIncludeDir, clangVersion] = getClangIncludeDirAndVersion(m_currentRunner.get());
|
auto [clangIncludeDir, clangVersion] = getClangIncludeDirAndVersion(m_currentRunner.get());
|
||||||
qCDebug(LOG) << Q_FUNC_INFO << m_currentRunner->executable() << clangIncludeDir
|
qCDebug(LOG) << Q_FUNC_INFO << m_currentRunner->executable() << clangIncludeDir
|
||||||
<< clangVersion << m_fileInfo.file;
|
<< clangVersion << m_fileInfo.file;
|
||||||
AnalyzeUnit unit(m_fileInfo, clangIncludeDir, clangVersion);
|
if (clangIncludeDir.isEmpty() || clangVersion.isEmpty()) {
|
||||||
QTC_ASSERT(Utils::FilePath::fromString(unit.file).exists(), runNext(); return;);
|
|
||||||
m_currentRunner->setVFSOverlay(vfso().overlayFilePath().toString());
|
|
||||||
if (!m_currentRunner->run(unit.file, unit.arguments))
|
|
||||||
runNext();
|
runNext();
|
||||||
|
} else {
|
||||||
|
AnalyzeUnit unit(m_fileInfo, clangIncludeDir, clangVersion);
|
||||||
|
QTC_ASSERT(Utils::FilePath::fromString(unit.file).exists(), runNext(); return;);
|
||||||
|
m_currentRunner->setVFSOverlay(vfso().overlayFilePath().toString());
|
||||||
|
if (!m_currentRunner->run(unit.file, unit.arguments))
|
||||||
|
runNext();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
finalize();
|
finalize();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user