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,11 +303,16 @@ FilePath ClangdSettings::clangdIncludePath() const
|
||||
QTC_ASSERT(!clangdPath.isEmpty() && clangdPath.exists(), return {});
|
||||
const QVersionNumber version = clangdVersion();
|
||||
QTC_ASSERT(!version.isNull(), return {});
|
||||
const FilePath includePath = clangdPath.absolutePath().parentDir().pathAppended("lib/clang")
|
||||
.pathAppended(version.toString()).pathAppended("include");
|
||||
QTC_ASSERT(includePath.exists(), return {});
|
||||
static const QStringList libDirs{"lib", "lib64"};
|
||||
for (const QString &libDir : libDirs) {
|
||||
const FilePath includePath = clangdPath.absolutePath().parentDir().pathAppended(libDir)
|
||||
.pathAppended("clang").pathAppended(version.toString()).pathAppended("include");
|
||||
if (includePath.exists())
|
||||
return includePath;
|
||||
}
|
||||
QTC_CHECK(false);
|
||||
return {};
|
||||
}
|
||||
|
||||
FilePath ClangdSettings::clangdUserConfigFilePath()
|
||||
{
|
||||
|
Reference in New Issue
Block a user