diff options
author | Marco Bubke <marco.bubke@qt.io> | 2017-02-20 15:09:06 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2017-02-20 16:09:16 +0000 |
commit | 537217288ad482fb81da0e1ec6814744acd85168 (patch) | |
tree | 410033f0bd220f4d3e96516ebd2a9f97c9fda505 /src/plugins | |
parent | 58763aa996f8c975e50658c1dcb205831f4fbad5 (diff) | |
download | qt-creator-537217288ad482fb81da0e1ec6814744acd85168.tar.gz |
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')
-rw-r--r-- | src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.cpp index 8ae631eb2a..93c4bbd841 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(), |