forked from qt-creator/qt-creator
QbsProject: updateCppCodeModel() after building for extra compilers
We don't know the target files of extra compiler until we build the project. So, if we detect that situation when generating the code model, regenerate it after building the project the next time. Change-Id: I5dab9be2fcc14a11b01ecbc0d67f2d8e895c1b91 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -102,7 +102,8 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
|
|||||||
m_qbsUpdateFutureInterface(0),
|
m_qbsUpdateFutureInterface(0),
|
||||||
m_parsingScheduled(false),
|
m_parsingScheduled(false),
|
||||||
m_cancelStatus(CancelStatusNone),
|
m_cancelStatus(CancelStatusNone),
|
||||||
m_currentBc(0)
|
m_currentBc(0),
|
||||||
|
m_extraCompilersPending(false)
|
||||||
{
|
{
|
||||||
m_parsingDelay.setInterval(1000); // delay parsing by 1s.
|
m_parsingDelay.setInterval(1000); // delay parsing by 1s.
|
||||||
|
|
||||||
@@ -575,6 +576,10 @@ void QbsProject::updateAfterBuild()
|
|||||||
m_projectData = m_qbsProject.projectData();
|
m_projectData = m_qbsProject.projectData();
|
||||||
updateBuildTargetData();
|
updateBuildTargetData();
|
||||||
updateCppCompilerCallData();
|
updateCppCompilerCallData();
|
||||||
|
if (m_extraCompilersPending) {
|
||||||
|
m_extraCompilersPending = false;
|
||||||
|
updateCppCodeModel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProject::registerQbsProjectParser(QbsProjectParser *p)
|
void QbsProject::registerQbsProjectParser(QbsProjectParser *p)
|
||||||
@@ -798,8 +803,11 @@ void QbsProject::updateCppCodeModel()
|
|||||||
continue;
|
continue;
|
||||||
QStringList generated = m_qbsProject.generatedFiles(prd, source.filePath(),
|
QStringList generated = m_qbsProject.generatedFiles(prd, source.filePath(),
|
||||||
false);
|
false);
|
||||||
if (generated.isEmpty())
|
if (generated.isEmpty()) {
|
||||||
|
// We don't know the target files until we build for the first time.
|
||||||
|
m_extraCompilersPending = true;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const FileNameList fileNames = Utils::transform(generated,
|
const FileNameList fileNames = Utils::transform(generated,
|
||||||
[](const QString &s) {
|
[](const QString &s) {
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ private:
|
|||||||
|
|
||||||
QTimer m_parsingDelay;
|
QTimer m_parsingDelay;
|
||||||
QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers;
|
QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers;
|
||||||
|
bool m_extraCompilersPending;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user