Gcc: Support -stdlib=whatever arguments for the code model

Switching the stdlib implementation is possible with clang and results
in different include pathes being used (and potentially different defines).

Change-Id: I9c856256f51ceded9dc7892c1dde2bcc8c1b024c
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Tobias Hunger
2012-11-20 17:30:05 +01:00
parent 22c3bd244f
commit 75c36c9bb5
9 changed files with 34 additions and 17 deletions

View File

@@ -408,18 +408,21 @@ void AutotoolsProject::updateCppCodeModel()
QStringList allFrameworkPaths;
QByteArray macros;
QStringList cxxflags; // FIXME: Autotools should be able to do better than this!
if (activeTarget()) {
ProjectExplorer::Kit *k = activeTarget()->kit();
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
if (tc) {
const QList<HeaderPath> allHeaderPaths = tc->systemHeaderPaths(SysRootKitInformation::sysRoot(k));
const QList<HeaderPath> allHeaderPaths = tc->systemHeaderPaths(cxxflags,
SysRootKitInformation::sysRoot(k));
foreach (const HeaderPath &headerPath, allHeaderPaths) {
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
allFrameworkPaths.append(headerPath.path());
else
allIncludePaths.append(headerPath.path());
}
macros = tc->predefinedMacros(QStringList());
macros = tc->predefinedMacros(cxxflags);
macros += '\n';
}
}