forked from qt-creator/qt-creator
CppEditor: Consider non-canonical path to clang includes
The include directory is under lib64/ on some systems. Fixes: QTCREATORBUG-27623 Change-Id: Iba16e8ea451b444ab213fffd16f49dae865cd60e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Christian Kandeler
parent
32216652a8
commit
0978d16093
@@ -303,10 +303,15 @@ FilePath ClangdSettings::clangdIncludePath() const
|
|||||||
QTC_ASSERT(!clangdPath.isEmpty() && clangdPath.exists(), return {});
|
QTC_ASSERT(!clangdPath.isEmpty() && clangdPath.exists(), return {});
|
||||||
const QVersionNumber version = clangdVersion();
|
const QVersionNumber version = clangdVersion();
|
||||||
QTC_ASSERT(!version.isNull(), return {});
|
QTC_ASSERT(!version.isNull(), return {});
|
||||||
const FilePath includePath = clangdPath.absolutePath().parentDir().pathAppended("lib/clang")
|
static const QStringList libDirs{"lib", "lib64"};
|
||||||
.pathAppended(version.toString()).pathAppended("include");
|
for (const QString &libDir : libDirs) {
|
||||||
QTC_ASSERT(includePath.exists(), return {});
|
const FilePath includePath = clangdPath.absolutePath().parentDir().pathAppended(libDir)
|
||||||
return includePath;
|
.pathAppended("clang").pathAppended(version.toString()).pathAppended("include");
|
||||||
|
if (includePath.exists())
|
||||||
|
return includePath;
|
||||||
|
}
|
||||||
|
QTC_CHECK(false);
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePath ClangdSettings::clangdUserConfigFilePath()
|
FilePath ClangdSettings::clangdUserConfigFilePath()
|
||||||
|
Reference in New Issue
Block a user