CMakePM: Enable extra compilers only for files in the project

Qt Creator 4.15 added the "<File System>" project node containing all
the files in the source directory.

Qt Creator for its "find extra compilers" step needs only the files
from the project and not all the files in the system.

Task-number: QTCREATORBUG-25783
Change-Id: I5d33d5296f67ab3f321c232e5071f32e56d29101
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-06-09 15:48:59 +02:00
parent 80d18c1e57
commit 4c699d5181

View File

@@ -1142,7 +1142,7 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeBuildSystem::findExtraCompilers()
// Find all files generated by any of the extra compilers, in a rather crude way.
Project *p = project();
const FilePaths fileList = p->files([&fileExtensions](const Node *n) {
if (!Project::SourceFiles(n))
if (!Project::SourceFiles(n) || !n->isEnabled()) // isEnabled excludes nodes from the file system tree
return false;
const QString fp = n->filePath().toString();
const int pos = fp.lastIndexOf('.');