forked from qt-creator/qt-creator
QmakeProjectManager: Do not ignore files from included .pri files
... when setting up extra compilers. For example, the code model was not able to resolve included ui_*.h files in a project that wasn't built yet, if the respective FORMS declaration came from a .pri file. Fixes: QTCREATORBUG-22395 Change-Id: I75c4b2b38fec209519adb563d579ecd3a17fe042 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
@@ -234,6 +234,16 @@ QSet<FileName> QmakePriFile::files(const FileType &type) const
|
|||||||
return m_files.value(type);
|
return m_files.value(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QSet<FileName> QmakePriFile::collectFiles(const FileType &type) const
|
||||||
|
{
|
||||||
|
QSet<FileName> allFiles = files(type);
|
||||||
|
for (const QmakePriFile * const priFile : qAsConst(m_children)) {
|
||||||
|
if (!dynamic_cast<const QmakeProFile *>(priFile))
|
||||||
|
allFiles.unite(priFile->collectFiles(type));
|
||||||
|
}
|
||||||
|
return allFiles;
|
||||||
|
}
|
||||||
|
|
||||||
QmakePriFile::~QmakePriFile()
|
QmakePriFile::~QmakePriFile()
|
||||||
{
|
{
|
||||||
watchFolders( {} );
|
watchFolders( {} );
|
||||||
@@ -1958,12 +1968,11 @@ QList<ExtraCompiler *> QmakeProFile::extraCompilers() const
|
|||||||
void QmakeProFile::setupExtraCompiler(const FileName &buildDir,
|
void QmakeProFile::setupExtraCompiler(const FileName &buildDir,
|
||||||
const FileType &fileType, ExtraCompilerFactory *factory)
|
const FileType &fileType, ExtraCompilerFactory *factory)
|
||||||
{
|
{
|
||||||
foreach (const FileName &fn, files(fileType)) {
|
for (const FileName &fn : collectFiles(fileType)) {
|
||||||
const FileNameList generated = generatedFiles(buildDir, fn, fileType);
|
const FileNameList generated = generatedFiles(buildDir, fn, fileType);
|
||||||
if (!generated.isEmpty()) {
|
if (!generated.isEmpty())
|
||||||
m_extraCompilers.append(factory->create(m_project, fn, generated));
|
m_extraCompilers.append(factory->create(m_project, fn, generated));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmakeProFile::updateGeneratedFiles(const FileName &buildDir)
|
void QmakeProFile::updateGeneratedFiles(const FileName &buildDir)
|
||||||
|
@@ -133,8 +133,12 @@ public:
|
|||||||
|
|
||||||
void makeEmpty();
|
void makeEmpty();
|
||||||
|
|
||||||
|
// Files of the specified type declared in this file.
|
||||||
QSet<Utils::FileName> files(const ProjectExplorer::FileType &type) const;
|
QSet<Utils::FileName> files(const ProjectExplorer::FileType &type) const;
|
||||||
|
|
||||||
|
// Files of the specified type declared in this file and in included .pri files.
|
||||||
|
const QSet<Utils::FileName> collectFiles(const ProjectExplorer::FileType &type) const;
|
||||||
|
|
||||||
void update(const Internal::QmakePriFileEvalResult &result);
|
void update(const Internal::QmakePriFileEvalResult &result);
|
||||||
|
|
||||||
bool canAddSubProject(const QString &proFilePath) const;
|
bool canAddSubProject(const QString &proFilePath) const;
|
||||||
|
Reference in New Issue
Block a user