diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index 7b050a5ed64..dad44e2f6ba 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -234,6 +234,16 @@ QSet QmakePriFile::files(const FileType &type) const return m_files.value(type); } +const QSet QmakePriFile::collectFiles(const FileType &type) const +{ + QSet allFiles = files(type); + for (const QmakePriFile * const priFile : qAsConst(m_children)) { + if (!dynamic_cast(priFile)) + allFiles.unite(priFile->collectFiles(type)); + } + return allFiles; +} + QmakePriFile::~QmakePriFile() { watchFolders( {} ); @@ -1958,11 +1968,10 @@ QList QmakeProFile::extraCompilers() const void QmakeProFile::setupExtraCompiler(const FileName &buildDir, const FileType &fileType, ExtraCompilerFactory *factory) { - foreach (const FileName &fn, files(fileType)) { + for (const FileName &fn : collectFiles(fileType)) { const FileNameList generated = generatedFiles(buildDir, fn, fileType); - if (!generated.isEmpty()) { + if (!generated.isEmpty()) m_extraCompilers.append(factory->create(m_project, fn, generated)); - } } } diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h index 68b406fe63a..4c5b7048eb2 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h @@ -133,8 +133,12 @@ public: void makeEmpty(); + // Files of the specified type declared in this file. QSet files(const ProjectExplorer::FileType &type) const; + // Files of the specified type declared in this file and in included .pri files. + const QSet collectFiles(const ProjectExplorer::FileType &type) const; + void update(const Internal::QmakePriFileEvalResult &result); bool canAddSubProject(const QString &proFilePath) const;