summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r--src/plugins/cpptools/compileroptionsbuilder.cpp29
-rw-r--r--src/plugins/cpptools/compileroptionsbuilder.h2
2 files changed, 13 insertions, 18 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp
index c3b8f115f2..f60434f7a4 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.cpp
+++ b/src/plugins/cpptools/compileroptionsbuilder.cpp
@@ -296,27 +296,22 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
using ProjectExplorer::HeaderPath;
using ProjectExplorer::HeaderPathType;
+ for (const HeaderPath &headerPath : filter.userHeaderPaths)
+ addIncludeDirOptionForPath(headerPath);
+ for (const HeaderPath &headerPath : filter.systemHeaderPaths)
+ addIncludeDirOptionForPath(headerPath);
+
if (m_useTweakedHeaderPaths == UseTweakedHeaderPaths::Yes) {
- // Exclude all built-in includes except Clang resource directory.
+ QTC_CHECK(!m_clangVersion.isEmpty()
+ && "Clang resource directory is required with UseTweakedHeaderPaths::Yes.");
- if (!isClStyle()) // MSVC does not have such include directories - ignore it for cl driver.
- m_options.prepend("-nostdlibinc");
+ // Exclude all built-in includes and Clang resource directory.
+ m_options.prepend("-nostdinc++");
+ m_options.prepend("-nostdinc");
- if (!m_clangVersion.isEmpty()) {
- // Exclude all built-in includes and Clang resource directory.
- m_options.prepend("-nostdinc");
- }
+ for (const HeaderPath &headerPath : filter.builtInHeaderPaths)
+ addIncludeDirOptionForPath(headerPath);
}
-
-
- for (const HeaderPath &headerPath : qAsConst(filter.userHeaderPaths))
- addIncludeDirOptionForPath(headerPath);
-
- for (const HeaderPath &headerPath : qAsConst(filter.systemHeaderPaths))
- addIncludeDirOptionForPath(headerPath);
-
- for (const HeaderPath &headerPath : qAsConst(filter.builtInHeaderPaths))
- addIncludeDirOptionForPath(headerPath);
}
void CompilerOptionsBuilder::addPrecompiledHeaderOptions(UsePrecompiledHeaders usePrecompiledHeaders)
diff --git a/src/plugins/cpptools/compileroptionsbuilder.h b/src/plugins/cpptools/compileroptionsbuilder.h
index 0d0ca84488..4667b7a72f 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.h
+++ b/src/plugins/cpptools/compileroptionsbuilder.h
@@ -45,7 +45,7 @@ class CPPTOOLS_EXPORT CompilerOptionsBuilder
public:
CompilerOptionsBuilder(const ProjectPart &projectPart,
UseSystemHeader useSystemHeader = UseSystemHeader::No,
- UseTweakedHeaderPaths useTweakedHeaderPaths = UseTweakedHeaderPaths::Yes,
+ UseTweakedHeaderPaths useTweakedHeaderPaths = UseTweakedHeaderPaths::No,
UseLanguageDefines useLanguageDefines = UseLanguageDefines::No,
const QString &clangVersion = QString(),
const QString &clangResourceDirectory = QString());