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>
This commit is contained in:
parent
e2b90768ae
commit
eb9da60f0c
@ -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");
|
||||
|
@ -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 {
|
||||
|
@ -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]; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user