forked from qt-creator/qt-creator
Fix LLVM tools version query
On Debian clang tools are prefixed with "Debian ": $ clang-tidy --version Debian LLVM version 13.0.0 Optimized build. Default target: x86_64-pc-linux-gnu Host CPU: bdver2 Change-Id: I03886d2674a3851c0cf391afc1c1672b0349184e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
committed by
BogDan Vatra
parent
aa0f57b52a
commit
d7f68ba174
@@ -228,8 +228,9 @@ QString queryVersion(const FilePath &clangToolPath, QueryFailMode failMode)
|
||||
static const QStringList versionPrefixes{"LLVM version ", "clang version: "};
|
||||
const QString line = stream.readLine().simplified();
|
||||
for (const QString &prefix : versionPrefixes) {
|
||||
if (line.startsWith(prefix))
|
||||
return line.mid(prefix.length());
|
||||
auto idx = line.indexOf(prefix);
|
||||
if (idx >= 0)
|
||||
return line.mid(idx + prefix.length());
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user