forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/10.0'
Change-Id: I7bd186df0bfae7906e980e9c2c811f8dcf29750d
This commit is contained in:
@@ -364,11 +364,15 @@ 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");
|
||||
if (includePath.exists())
|
||||
return includePath;
|
||||
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