CMake: Use FilePath::suffix() instead of manual construction

Change-Id: Id2bc542047ce5f4ff1937be90b976d330b69c51a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
hjk
2022-11-23 12:53:58 +01:00
parent c10600134f
commit 7fd3a5e66e

View File

@@ -1143,9 +1143,8 @@ QList<ExtraCompiler *> CMakeBuildSystem::findExtraCompilers()
const FilePaths fileList = p->files([&fileExtensions](const Node *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('.');
return pos >= 0 && fileExtensions.contains(fp.mid(pos + 1));
const QString suffix = n->filePath().suffix();
return !suffix.isEmpty() && fileExtensions.contains(suffix);
});
qCDebug(cmakeBuildSystemLog) << "Finding Extra Compilers: Got list of files to check.";