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,11 +363,15 @@ static FilePath getClangHeadersPath(const FilePath &clangdFilePath)
|
|||||||
const QVersionNumber version = Utils::clangdVersion(clangdFilePath);
|
const QVersionNumber version = Utils::clangdVersion(clangdFilePath);
|
||||||
QTC_ASSERT(!version.isNull(), return {});
|
QTC_ASSERT(!version.isNull(), return {});
|
||||||
static const QStringList libDirs{"lib", "lib64"};
|
static const QStringList libDirs{"lib", "lib64"};
|
||||||
|
const QStringList versionStrings{QString::number(version.majorVersion()), version.toString()};
|
||||||
for (const QString &libDir : libDirs) {
|
for (const QString &libDir : libDirs) {
|
||||||
const FilePath includePath = clangdFilePath.absolutePath().parentDir().pathAppended(libDir)
|
for (const QString &versionString : versionStrings) {
|
||||||
.pathAppended("clang").pathAppended(version.toString()).pathAppended("include");
|
const FilePath includePath = clangdFilePath.absolutePath().parentDir()
|
||||||
if (includePath.exists())
|
.pathAppended(libDir).pathAppended("clang")
|
||||||
return includePath;
|
.pathAppended(versionString).pathAppended("include");
|
||||||
|
if (includePath.exists())
|
||||||
|
return includePath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
QTC_CHECK(false);
|
QTC_CHECK(false);
|
||||||
return {};
|
return {};
|
||||||
|
Reference in New Issue
Block a user