forked from qt-creator/qt-creator
Clang: Skip built-in includes when exporting the compilation database
We don't want to have compiler-specific paths there. Change-Id: If26434ea3760d4f2ca4c25bbcf0340f4ea781072 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -43,12 +43,14 @@ namespace CppTools {
|
||||
|
||||
CompilerOptionsBuilder::CompilerOptionsBuilder(const ProjectPart &projectPart,
|
||||
UseSystemHeader useSystemHeader,
|
||||
SkipBuiltIn skipBuiltInHeaderPaths,
|
||||
QString clangVersion,
|
||||
QString clangResourceDirectory)
|
||||
: m_projectPart(projectPart)
|
||||
, m_useSystemHeader(useSystemHeader)
|
||||
, m_clangVersion(clangVersion)
|
||||
, m_clangResourceDirectory(clangResourceDirectory)
|
||||
, m_skipBuiltInHeaderPaths(skipBuiltInHeaderPaths)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -237,7 +239,8 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
|
||||
|
||||
m_options.append(includes);
|
||||
m_options.append(systemIncludes);
|
||||
m_options.append(builtInIncludes);
|
||||
if (m_skipBuiltInHeaderPaths == SkipBuiltIn::No)
|
||||
m_options.append(builtInIncludes);
|
||||
}
|
||||
|
||||
void CompilerOptionsBuilder::addPrecompiledHeaderOptions(PchUsage pchUsage)
|
||||
|
||||
@@ -37,6 +37,12 @@ enum class UseSystemHeader
|
||||
No
|
||||
};
|
||||
|
||||
enum class SkipBuiltIn
|
||||
{
|
||||
Yes,
|
||||
No
|
||||
};
|
||||
|
||||
class CPPTOOLS_EXPORT CompilerOptionsBuilder
|
||||
{
|
||||
public:
|
||||
@@ -47,6 +53,7 @@ public:
|
||||
|
||||
CompilerOptionsBuilder(const ProjectPart &projectPart,
|
||||
UseSystemHeader useSystemHeader = UseSystemHeader::No,
|
||||
SkipBuiltIn skipBuiltInHeaderPaths = SkipBuiltIn::No,
|
||||
QString clangVersion = QString(),
|
||||
QString clangResourceDirectory = QString());
|
||||
virtual ~CompilerOptionsBuilder() {}
|
||||
@@ -106,6 +113,8 @@ private:
|
||||
|
||||
QString m_clangVersion;
|
||||
QString m_clangResourceDirectory;
|
||||
|
||||
SkipBuiltIn m_skipBuiltInHeaderPaths;
|
||||
};
|
||||
|
||||
} // namespace CppTools
|
||||
|
||||
Reference in New Issue
Block a user