forked from qt-creator/qt-creator
Clang: Explicitly set the target triple
As for the analyzer, this makes us independent of the default triple and will most likely reduce the maintenance - e.g. the target implies certain internal command line arguments, we will profit from added ones. This fixes parsing of mingw headers with the clang code model. Change-Id: I722b981125a80fac5f62a7af40a83ecdd7bbf811 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -262,6 +262,23 @@ ProjectPartHeaderPath toProjectPartHeaderPath(const ProjectExplorer::HeaderPath
|
||||
return ProjectPartHeaderPath(headerPath.path(), headerPathType);
|
||||
}
|
||||
|
||||
QString targetTriple(ProjectExplorer::Project *project, const Core::Id &toolchainId)
|
||||
{
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
if (toolchainId == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID)
|
||||
return QLatin1String("i686-pc-windows-msvc");
|
||||
|
||||
if (project) {
|
||||
if (Target *target = project->activeTarget()) {
|
||||
if (ToolChain *toolChain = ToolChainKitInformation::toolChain(target->kit()))
|
||||
return toolChain->originalTargetTriple();
|
||||
}
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -324,6 +341,7 @@ void ProjectPartBuilder::evaluateProjectPartToolchain(
|
||||
|
||||
projectPart->toolchainDefines = toolChain->predefinedMacros(commandLineFlags);
|
||||
projectPart->toolchainType = toolChain->typeId();
|
||||
projectPart->targetTriple = targetTriple(projectPart->project, toolChain->typeId());
|
||||
projectPart->updateLanguageFeatures();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user