implement simple VFS to support caching during project parsing

this tremendously speeds up loading of qt 5.1 based projects (including
qt itself) under mac os, as these look up the sdk dynamically, and use
caching to avoid doing that in every subproject.

Change-Id: I833253f81c3159056fab2ff888f293b36cc2ef56
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Oswald Buddenhagen
2013-05-29 20:18:51 +02:00
parent 571234786a
commit 66802ef8bf
20 changed files with 365 additions and 91 deletions
+8 -5
View File
@@ -28,6 +28,7 @@
****************************************************************************/
#include "qmakeglobals.h"
#include "qmakevfs.h"
#include "qmakeparser.h"
#include "qmakeevaluator.h"
#include "profileevaluator.h"
@@ -69,14 +70,15 @@ public:
static EvalHandler evalHandler;
static int evaluate(const QString &fileName, const QString &in_pwd, const QString &out_pwd,
bool cumulative, ProFileGlobals *option, QMakeParser *parser, int level)
bool cumulative, ProFileGlobals *option, QMakeParser *parser, QMakeVfs *vfs,
int level)
{
static QSet<QString> visited;
if (visited.contains(fileName))
return 0;
visited.insert(fileName);
ProFileEvaluator visitor(option, parser, &evalHandler);
ProFileEvaluator visitor(option, parser, vfs, &evalHandler);
#ifdef PROEVALUATOR_CUMULATIVE
visitor.setCumulative(cumulative);
#endif
@@ -130,7 +132,7 @@ static int evaluate(const QString &fileName, const QString &in_pwd, const QStrin
fflush(stdout);
nlevel++;
}
evaluate(inFile, inPwd, outPwd, cumulative, option, parser, nlevel);
evaluate(inFile, inPwd, outPwd, cumulative, option, parser, vfs, nlevel);
}
}
@@ -195,6 +197,7 @@ int main(int argc, char **argv)
out_pwd = in_pwd;
option.setDirectories(in_pwd, out_pwd);
QMakeParser parser(0, &evalHandler);
return evaluate(file, in_pwd, out_pwd, cumulative, &option, &parser, level);
QMakeVfs vfs;
QMakeParser parser(0, &vfs, &evalHandler);
return evaluate(file, in_pwd, out_pwd, cumulative, &option, &parser, &vfs, level);
}