Commit 7ab2ed57 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Pass C or Cxx toolchain to code model



Pass the C toolChain to the code model for all the C-versions creator
supports.

Change-Id: I0300a19d35861fcee76fb92ce14c6e04996bac7f
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent abcb2764
......@@ -361,9 +361,16 @@ void ProjectPartBuilder::createProjectPart(const QVector<ProjectFile> &theSource
QTC_ASSERT(part->project, return);
if (ProjectExplorer::Target *activeTarget = part->project->activeTarget()) {
if (ProjectExplorer::Kit *kit = activeTarget->kit()) {
if (ProjectExplorer::ToolChain *toolChain = ProjectExplorer::ToolChainKitInformation::toolChain(kit, ProjectExplorer::ToolChain::Language::Cxx)) {
const QStringList flags = languageVersion >= ProjectPart::CXX98 ? m_cxxFlags
: m_cFlags;
ProjectExplorer::ToolChain *toolChain = nullptr;
if (languageVersion < ProjectPart::CXX98)
toolChain = ProjectExplorer::ToolChainKitInformation::toolChain(kit, ProjectExplorer::ToolChain::Language::C);
if (!toolChain) // Use Cxx toolchain for C projects without C compiler in kit and for C++ code
toolChain = ProjectExplorer::ToolChainKitInformation::toolChain(kit, ProjectExplorer::ToolChain::Language::Cxx);
if (toolChain) {
const QStringList flags
= (toolChain->language() == ProjectExplorer::ToolChain::Language::Cxx)
? m_cxxFlags : m_cFlags;
evaluateProjectPartToolchain(part.data(),
toolChain,
flags,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment