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:
@@ -160,11 +160,12 @@ static FileInfo getFileInfo(const FilePath &file, Project *project)
|
||||
if (!projectFile.active)
|
||||
continue;
|
||||
// found the best candidate, early return
|
||||
ProjectFile::Kind sourceKind = ProjectFile::sourceKind(projectFile.kind);
|
||||
if (projectPart->buildTargetType != BuildTargetType::Unknown)
|
||||
return FileInfo(projectFilePath, projectFile.kind, projectPart);
|
||||
return FileInfo(projectFilePath, sourceKind, projectPart);
|
||||
// found something but keep looking for better candidates
|
||||
if (candidate.projectPart.isNull())
|
||||
candidate = FileInfo(projectFilePath, projectFile.kind, projectPart);
|
||||
candidate = FileInfo(projectFilePath, sourceKind, projectPart);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user