summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-08-22 14:10:35 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-05 03:03:10 +0200
commit791cb024637e865e98b336bc63b8e1fcbae3befc (patch)
treeb9d8eb2848a4c7c6468b49e15be8beb42a62fcb1 /qmake
parent09df6bec737bd9b59dc26bd76e891634aab4ab22 (diff)
make QMakeMetaInfo a little less inefficient with libtool .la files
don't read the spec from scratch for every library just to get QMAKE_LFLAGS_RPATH. we can perfectly use our current project for that purpose. Change-Id: I4e408b3fd5de81652181df032aa53cd8f2f8f806 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--qmake/generators/makefile.cpp2
-rw-r--r--qmake/generators/unix/unixmake2.cpp2
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
-rw-r--r--qmake/meta.cpp10
-rw-r--r--qmake/meta.h5
6 files changed, 10 insertions, 13 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 27bc1e48fb..07224d8c43 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -815,7 +815,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
*/
QString lib_file = (*lit) + Option::dir_sep + lib;
if(QMakeMetaInfo::libExists(lib_file)) {
- QMakeMetaInfo libinfo;
+ QMakeMetaInfo libinfo(project);
if(libinfo.readLib(lib_file)) {
if(!libinfo.isEmpty("QMAKE_PRL_TARGET")) {
library = (*lit) + Option::dir_sep + libinfo.first("QMAKE_PRL_TARGET");
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 8d0c78a861..79f9659536 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -888,7 +888,7 @@ MakefileGenerator::processPrlFile(QString &file)
if(!meta_file.isEmpty()) {
QString f = fileFixify(real_meta_file, qmake_getpwd(), Option::output_dir);
if(QMakeMetaInfo::libExists(f)) {
- QMakeMetaInfo libinfo;
+ QMakeMetaInfo libinfo(project);
debug_msg(1, "Processing PRL file: %s", real_meta_file.toLatin1().constData());
if(!libinfo.readLib(f)) {
fprintf(stderr, "Error processing meta file: %s\n", real_meta_file.toLatin1().constData());
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 6e01da5baf..45ed14917f 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -353,7 +353,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
const QStringList &l = project->values("QMAKE_PRL_INTERNAL_FILES");
QStringList::ConstIterator it;
for(it = l.begin(); it != l.end(); ++it) {
- QMakeMetaInfo libinfo;
+ QMakeMetaInfo libinfo(project);
if(libinfo.readLib((*it)) && !libinfo.isEmpty("QMAKE_PRL_BUILD_DIR")) {
QString dir;
int slsh = (*it).lastIndexOf(Option::dir_sep);
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index b49ce82a92..b3c998bb53 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -64,7 +64,7 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
if(!exists(bd))
return -1;
- QMakeMetaInfo libinfo;
+ QMakeMetaInfo libinfo(project);
bool libInfoRead = libinfo.readLib(bd + Option::dir_sep + stem);
// If the library, for which we're trying to find the highest version
diff --git a/qmake/meta.cpp b/qmake/meta.cpp
index 3ec3f8357b..717da74704 100644
--- a/qmake/meta.cpp
+++ b/qmake/meta.cpp
@@ -48,7 +48,8 @@ QT_BEGIN_NAMESPACE
QHash<QString, QHash<QString, QStringList> > QMakeMetaInfo::cache_vars;
-QMakeMetaInfo::QMakeMetaInfo()
+QMakeMetaInfo::QMakeMetaInfo(QMakeProject *_conf)
+ : conf(_conf)
{
}
@@ -180,19 +181,12 @@ QMakeMetaInfo::readLibtoolFile(const QString &f)
dep = dep.mid(1, dep.length() - 2);
lst = dep.trimmed().split(" ");
}
- QMakeProject *conf = NULL;
for(QStringList::Iterator lit = lst.begin(); lit != lst.end(); ++lit) {
if((*lit).startsWith("-R")) {
- if(!conf) {
- conf = new QMakeProject;
- conf->read(QMakeProject::ReadAll ^ QMakeProject::ReadProFile);
- }
if(!conf->isEmpty("QMAKE_LFLAGS_RPATH"))
(*lit) = conf->first("QMAKE_LFLAGS_RPATH") + (*lit).mid(2);
}
}
- if(conf)
- delete conf;
vars["QMAKE_PRL_LIBS"] += lst;
}
}
diff --git a/qmake/meta.h b/qmake/meta.h
index 71d7f5f2de..bfdb1088dc 100644
--- a/qmake/meta.h
+++ b/qmake/meta.h
@@ -48,16 +48,19 @@
QT_BEGIN_NAMESPACE
+class QMakeProject;
+
class QMakeMetaInfo
{
bool readLibtoolFile(const QString &f);
bool readPkgCfgFile(const QString &f);
+ QMakeProject *conf;
QHash<QString, QStringList> vars;
QString meta_type;
static QHash<QString, QHash<QString, QStringList> > cache_vars;
void clear();
public:
- QMakeMetaInfo();
+ QMakeMetaInfo(QMakeProject *_conf);
bool readLib(QString lib);
static QString findLib(QString lib);