aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2017-02-20 15:09:06 +0100
committerMarco Bubke <marco.bubke@qt.io>2017-02-20 16:09:16 +0000
commit537217288ad482fb81da0e1ec6814744acd85168 (patch)
tree410033f0bd220f4d3e96516ebd2a9f97c9fda505 /src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
parent58763aa996f8c975e50658c1dcb205831f4fbad5 (diff)
Clang: Ignore CHeader
Because we don't now if a *.h file is a C or C++ header we provide both as project file if a C and C++ file is present. But C++ is not readable by C compiler. So we skip that files and hope there is no non referenced C header, which is very very unlikely. Change-Id: I5505713e759749c8a0738e11b70bb6b309412966 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp')
-rw-r--r--src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
index 8ae631eb2a2..93c4bbd841f 100644
--- a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
+++ b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp
@@ -168,6 +168,11 @@ bool unsavedContentContains(const ClangBackEnd::FilePath &sourceFilePath,
return found != unsavedContent.end();
}
+bool isCHeader(CppTools::ProjectFile::Kind kind)
+{
+ return kind == CppTools::ProjectFile::CHeader;
+}
+
void appendSource(std::vector<ClangBackEnd::V2::FileContainer> &sources,
const CppTools::ProjectPart::Ptr &projectPart,
const CppTools::ProjectFile &projectFile,
@@ -175,7 +180,7 @@ void appendSource(std::vector<ClangBackEnd::V2::FileContainer> &sources,
{
ClangBackEnd::FilePath sourceFilePath(projectFile.path);
- if (!unsavedContentContains(sourceFilePath, unsavedContent)) {
+ if (!unsavedContentContains(sourceFilePath, unsavedContent) && !isCHeader(projectFile.kind)) {
sources.emplace_back(ClangBackEnd::FilePath(projectFile.path),
"",
createCommandLine(projectPart.data(),