diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2017-12-14 12:49:26 +0100 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2017-12-14 14:24:35 +0000 |
commit | c76080410222685484515bbac86e3852138aa825 (patch) | |
tree | 2f0f4ed02daf107b5c212129fcdb701589401320 /src | |
parent | c21657184ba9aa08493101f97c651f548fa65d77 (diff) | |
download | qt-creator-c76080410222685484515bbac86e3852138aa825.tar.gz |
Clang: always use -isystem for compiler options builder
We always provide the full includes list ourselves so
it will not change the includes order.
Change-Id: I84ee2ca7f05bfb71ae400f0e9e0b8f52810252b3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/clangcodemodel/clangutils.cpp | 12 | ||||
-rw-r--r-- | src/plugins/cpptools/compileroptionsbuilder.cpp | 8 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index 63f9712246..dea79f6625 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -120,16 +120,20 @@ private: if (m_projectPart.qtVersion != CppTools::ProjectPart::NoQt) { const QString wrappedQtCoreHeaderPath = wrappedQtHeadersPath + "/QtCore"; - add(includeDirOption() + QDir::toNativeSeparators(wrappedQtHeadersPath)); - add(includeDirOption() + QDir::toNativeSeparators(wrappedQtCoreHeaderPath)); + add(includeDirOption()); + add(QDir::toNativeSeparators(wrappedQtHeadersPath)); + add(includeDirOption()); + add(QDir::toNativeSeparators(wrappedQtCoreHeaderPath)); } } void addDummyUiHeaderOnDiskIncludePath() { const QString path = ModelManagerSupportClang::instance()->dummyUiHeaderOnDiskDirPath(); - if (!path.isEmpty()) - add(includeDirOption() + QDir::toNativeSeparators(path)); + if (!path.isEmpty()) { + add(includeDirOption()); + add(QDir::toNativeSeparators(path)); + } } }; diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index 8de175fa16..9f11c02bb9 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -136,7 +136,8 @@ void CompilerOptionsBuilder::addHeaderPathOptions() break; } - result.append(prefix + QDir::toNativeSeparators(headerPath.path)); + result.append(prefix); + result.append(QDir::toNativeSeparators(headerPath.path)); } m_options.append(result); @@ -399,7 +400,7 @@ void CompilerOptionsBuilder::addDefineFunctionMacrosMsvc() QString CompilerOptionsBuilder::includeDirOption() const { - return QLatin1String("-I"); + return QLatin1String("-isystem"); } QByteArray CompilerOptionsBuilder::macroOption(const ProjectExplorer::Macro ¯o) const @@ -501,7 +502,8 @@ void CompilerOptionsBuilder::addPredefinedHeaderPathsOptions() void CompilerOptionsBuilder::addClangIncludeFolder() { QTC_CHECK(!m_clangVersion.isEmpty()); - add(includeDirOption() + clangIncludeDirectory()); + add(includeDirOption()); + add(clangIncludeDirectory()); } void CompilerOptionsBuilder::addProjectConfigFileInclude() |