forked from qt-creator/qt-creator
CppEditor: Adapt to new LLVM directory layout
Since https://reviews.llvm.org/D125860, the path contains only the major version. We try both variants anyway, as we cannot be sure all Linux distributions will adopt this scheme. Change-Id: I0bc7b0cf38d7cb4af61342477a6a1f0679095d30 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -363,12 +363,16 @@ static FilePath getClangHeadersPath(const FilePath &clangdFilePath)
|
||||
const QVersionNumber version = Utils::clangdVersion(clangdFilePath);
|
||||
QTC_ASSERT(!version.isNull(), return {});
|
||||
static const QStringList libDirs{"lib", "lib64"};
|
||||
const QStringList versionStrings{QString::number(version.majorVersion()), version.toString()};
|
||||
for (const QString &libDir : libDirs) {
|
||||
const FilePath includePath = clangdFilePath.absolutePath().parentDir().pathAppended(libDir)
|
||||
.pathAppended("clang").pathAppended(version.toString()).pathAppended("include");
|
||||
for (const QString &versionString : versionStrings) {
|
||||
const FilePath includePath = clangdFilePath.absolutePath().parentDir()
|
||||
.pathAppended(libDir).pathAppended("clang")
|
||||
.pathAppended(versionString).pathAppended("include");
|
||||
if (includePath.exists())
|
||||
return includePath;
|
||||
}
|
||||
}
|
||||
QTC_CHECK(false);
|
||||
return {};
|
||||
}
|
||||
|
Reference in New Issue
Block a user