diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-07-09 18:49:13 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-07-16 15:44:18 +0000 |
commit | eb9da60f0c87cb4a3b2b26a66888c0f95cdfa6b4 (patch) | |
tree | b0c38104c49b682360b42fdbe9936af193965490 | |
parent | e2b90768ae2e19fe1a888c4a0ea9f5b31a973811 (diff) |
qmake: purge infra for supporting multiple formats from QMakeMetaInfo
only .prl is actually supported (and we expect this to remain the case),
so just simplify the code.
Change-Id: Ia23f9f257bf89ca214c3deabd8a7744b155c7aa9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | qmake/generators/makefile.cpp | 5 | ||||
-rw-r--r-- | qmake/meta.cpp | 40 | ||||
-rw-r--r-- | qmake/meta.h | 5 |
3 files changed, 12 insertions, 38 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 2f8c653d62..035493b9ce 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -898,9 +898,8 @@ MakefileGenerator::processPrlFile(QString &file) fprintf(stderr, "Error processing meta file %s\n", meta_file.toLatin1().constData()); return false; } - if (project->isActiveConfig("no_read_prl_" + libinfo.type().toLower())) { - debug_msg(2, "Ignored meta file %s [%s]", - meta_file.toLatin1().constData(), libinfo.type().toLatin1().constData()); + if (project->isActiveConfig("no_read_prl_qmake")) { + debug_msg(2, "Ignored meta file %s", meta_file.toLatin1().constData()); return false; } project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS"); diff --git a/qmake/meta.cpp b/qmake/meta.cpp index 9149b87321..a3e5024137 100644 --- a/qmake/meta.cpp +++ b/qmake/meta.cpp @@ -50,23 +50,12 @@ QMakeMetaInfo::readLib(const QString &meta_file) return true; } - bool ret = false; - if(!meta_file.isNull()) { - if (meta_file.endsWith(Option::prl_ext)) { - QMakeProject proj; - if (!proj.read(Option::normalizePath(meta_file), QMakeEvaluator::LoadProOnly)) - return false; - meta_type = "qmake"; - vars = proj.variables(); - ret = true; - } else { - warn_msg(WarnLogic, "QMakeMetaInfo: unknown file format for %s", - QDir::toNativeSeparators(meta_file).toLatin1().constData()); - } - } - if(ret) - cache_vars.insert(meta_file, vars); - return ret; + QMakeProject proj; + if (!proj.read(Option::normalizePath(meta_file), QMakeEvaluator::LoadProOnly)) + return false; + vars = proj.variables(); + cache_vars.insert(meta_file, vars); + return true; } @@ -74,19 +63,10 @@ QString QMakeMetaInfo::findLib(const QString &lib) { QString ret; - QString extns[] = { Option::prl_ext, QString() }; - for(int extn = 0; !extns[extn].isNull(); extn++) { - if(lib.endsWith(extns[extn])) - ret = QFile::exists(lib) ? lib : QString(); - } - if(ret.isNull()) { - for(int extn = 0; !extns[extn].isNull(); extn++) { - if(QFile::exists(lib + extns[extn])) { - ret = lib + extns[extn]; - break; - } - } - } + if (lib.endsWith(Option::prl_ext)) + ret = QFile::exists(lib) ? lib : QString(); + else if (QFile::exists(lib + Option::prl_ext)) + ret = lib + Option::prl_ext; if(ret.isNull()) { debug_msg(2, "QMakeMetaInfo: Cannot find info file for %s", lib.toLatin1().constData()); } else { diff --git a/qmake/meta.h b/qmake/meta.h index 456635a9a9..b2a0f40054 100644 --- a/qmake/meta.h +++ b/qmake/meta.h @@ -43,7 +43,6 @@ class QMakeMetaInfo { QMakeProject *conf; ProValueMap vars; - QString meta_type; static QHash<QString, ProValueMap> cache_vars; public: QMakeMetaInfo(QMakeProject *_conf); @@ -52,7 +51,6 @@ public: static QString findLib(const QString &lib); bool readLib(const QString &meta_file); - QString type() const; bool isEmpty(const ProKey &v); ProStringList &values(const ProKey &v); ProString first(const ProKey &v); @@ -62,9 +60,6 @@ public: inline bool QMakeMetaInfo::isEmpty(const ProKey &v) { return !vars.contains(v) || vars[v].isEmpty(); } -inline QString QMakeMetaInfo::type() const -{ return meta_type; } - inline ProStringList &QMakeMetaInfo::values(const ProKey &v) { return vars[v]; } |