Commit a65630ef authored by Tobias Hunger's avatar Tobias Hunger

CMake: Pass C toolchain on to the project model

Change-Id: Ice833d9b180d7bac109c7cdf9e63fdba0bbce86e
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 4baa34ec
......@@ -285,11 +285,8 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
createGeneratedCodeModelSupport();
ToolChain *tc = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
if (!tc) {
emit fileListChanged();
return;
}
ToolChain *tcC = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::C_LANGUAGE_ID);
ToolChain *tcCxx = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
CppTools::ProjectPart::QtVersion activeQtVersion = CppTools::ProjectPart::NoQt;
if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k)) {
......@@ -307,11 +304,13 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
for (CppTools::RawProjectPart &rpp : rpps) {
// TODO: Set the Qt version only if target actually depends on Qt.
rpp.setQtVersion(activeQtVersion);
// TODO: Support also C
rpp.setFlagsForCxx({tc, rpp.flagsForCxx.commandLineFlags});
if (tcCxx)
rpp.setFlagsForCxx({tcCxx, rpp.flagsForCxx.commandLineFlags});
if (tcC)
rpp.setFlagsForC({tcC, rpp.flagsForC.commandLineFlags});
}
m_cppCodeModelUpdater->update({this, nullptr, tc, k, rpps});
m_cppCodeModelUpdater->update({this, tcC, tcCxx, k, rpps});
updateQmlJSCodeModel();
......
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