forked from qt-creator/qt-creator
ClangTools: Add header files to the list of files to be analyzed
Now that the CMakeProjectManager is reporting the header files as source files, it makes sense to analyze the headers as source files. Note that the header type needs to change to source type since the "cxx-header" argument that will be send if the Kind is CxxHeader is handled by the compiler as an argument to produce a precompiled header, which is not what we want. Fixes: QTCREATORBUG-21452 Fixes: QTCREATORBUG-25644 Fixes: QTCREATORBUG-25782 Change-Id: Icd674962ff8312b8fbfa46491938eb721edd761d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -340,9 +340,12 @@ static FileInfos sortedFileInfos(const QVector<CppEditor::ProjectPart::ConstPtr>
|
||||
if (file.path == CppEditor::CppModelManager::configurationFileName())
|
||||
continue;
|
||||
|
||||
if (file.active && CppEditor::ProjectFile::isSource(file.kind)) {
|
||||
if (file.active
|
||||
&& (CppEditor::ProjectFile::isSource(file.kind)
|
||||
|| CppEditor::ProjectFile::isHeader(file.kind))) {
|
||||
ProjectFile::Kind sourceKind = CppEditor::ProjectFile::sourceKind(file.kind);
|
||||
fileInfos.emplace_back(Utils::FilePath::fromString(file.path),
|
||||
file.kind,
|
||||
sourceKind,
|
||||
projectPart);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user