QmakePM: Improve performance of import

Shuffle order of parse and add short cuts in case we can
stop parsing early.

Change-Id: If03a5cbc0e51dc77f4b03b1cf1d07243f5b2a70b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2023-09-27 16:20:18 +02:00
parent 5a2df08ae0
commit cf6b6b5a8a
3 changed files with 25 additions and 10 deletions

View File

@@ -97,7 +97,7 @@ QList<void *> QmakeProjectImporter::examineDirectory(const FilePath &importPath,
qCDebug(logs) << " Parsing makefile" << file;
// find interesting makefiles
const FilePath makefile = importPath / file;
MakeFileParse parse(makefile, MakeFileParse::Mode::FilterKnownConfigValues);
MakeFileParse parse(makefile, MakeFileParse::Mode::FilterKnownConfigValues, projectFilePath());
if (parse.makeFileState() != MakeFileParse::Okay) {
qCDebug(logs) << " Parsing the makefile failed" << makefile;
continue;
@@ -108,7 +108,7 @@ QList<void *> QmakeProjectImporter::examineDirectory(const FilePath &importPath,
}
data->canonicalQmakeBinary = parse.qmakePath().canonicalPath();
if (data->canonicalQmakeBinary.isEmpty()) {
if (!data->canonicalQmakeBinary.exists()) {
qCDebug(logs) << " " << parse.qmakePath() << "doesn't exist anymore";
continue;
}