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());
|
fprintf(stderr, "Error processing meta file %s\n", meta_file.toLatin1().constData());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (project->isActiveConfig("no_read_prl_" + libinfo.type().toLower())) {
|
if (project->isActiveConfig("no_read_prl_qmake")) {
|
||||||
debug_msg(2, "Ignored meta file %s [%s]",
|
debug_msg(2, "Ignored meta file %s", meta_file.toLatin1().constData());
|
||||||
meta_file.toLatin1().constData(), libinfo.type().toLatin1().constData());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS");
|
project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS");
|
||||||
|
@ -50,23 +50,12 @@ QMakeMetaInfo::readLib(const QString &meta_file)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ret = false;
|
QMakeProject proj;
|
||||||
if(!meta_file.isNull()) {
|
if (!proj.read(Option::normalizePath(meta_file), QMakeEvaluator::LoadProOnly))
|
||||||
if (meta_file.endsWith(Option::prl_ext)) {
|
return false;
|
||||||
QMakeProject proj;
|
vars = proj.variables();
|
||||||
if (!proj.read(Option::normalizePath(meta_file), QMakeEvaluator::LoadProOnly))
|
cache_vars.insert(meta_file, vars);
|
||||||
return false;
|
return true;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -74,19 +63,10 @@ QString
|
|||||||
QMakeMetaInfo::findLib(const QString &lib)
|
QMakeMetaInfo::findLib(const QString &lib)
|
||||||
{
|
{
|
||||||
QString ret;
|
QString ret;
|
||||||
QString extns[] = { Option::prl_ext, QString() };
|
if (lib.endsWith(Option::prl_ext))
|
||||||
for(int extn = 0; !extns[extn].isNull(); extn++) {
|
ret = QFile::exists(lib) ? lib : QString();
|
||||||
if(lib.endsWith(extns[extn]))
|
else if (QFile::exists(lib + Option::prl_ext))
|
||||||
ret = QFile::exists(lib) ? lib : QString();
|
ret = lib + Option::prl_ext;
|
||||||
}
|
|
||||||
if(ret.isNull()) {
|
|
||||||
for(int extn = 0; !extns[extn].isNull(); extn++) {
|
|
||||||
if(QFile::exists(lib + extns[extn])) {
|
|
||||||
ret = lib + extns[extn];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(ret.isNull()) {
|
if(ret.isNull()) {
|
||||||
debug_msg(2, "QMakeMetaInfo: Cannot find info file for %s", lib.toLatin1().constData());
|
debug_msg(2, "QMakeMetaInfo: Cannot find info file for %s", lib.toLatin1().constData());
|
||||||
} else {
|
} else {
|
||||||
|
@ -43,7 +43,6 @@ class QMakeMetaInfo
|
|||||||
{
|
{
|
||||||
QMakeProject *conf;
|
QMakeProject *conf;
|
||||||
ProValueMap vars;
|
ProValueMap vars;
|
||||||
QString meta_type;
|
|
||||||
static QHash<QString, ProValueMap> cache_vars;
|
static QHash<QString, ProValueMap> cache_vars;
|
||||||
public:
|
public:
|
||||||
QMakeMetaInfo(QMakeProject *_conf);
|
QMakeMetaInfo(QMakeProject *_conf);
|
||||||
@ -52,7 +51,6 @@ public:
|
|||||||
static QString findLib(const QString &lib);
|
static QString findLib(const QString &lib);
|
||||||
bool readLib(const QString &meta_file);
|
bool readLib(const QString &meta_file);
|
||||||
|
|
||||||
QString type() const;
|
|
||||||
bool isEmpty(const ProKey &v);
|
bool isEmpty(const ProKey &v);
|
||||||
ProStringList &values(const ProKey &v);
|
ProStringList &values(const ProKey &v);
|
||||||
ProString first(const ProKey &v);
|
ProString first(const ProKey &v);
|
||||||
@ -62,9 +60,6 @@ public:
|
|||||||
inline bool QMakeMetaInfo::isEmpty(const ProKey &v)
|
inline bool QMakeMetaInfo::isEmpty(const ProKey &v)
|
||||||
{ return !vars.contains(v) || vars[v].isEmpty(); }
|
{ return !vars.contains(v) || vars[v].isEmpty(); }
|
||||||
|
|
||||||
inline QString QMakeMetaInfo::type() const
|
|
||||||
{ return meta_type; }
|
|
||||||
|
|
||||||
inline ProStringList &QMakeMetaInfo::values(const ProKey &v)
|
inline ProStringList &QMakeMetaInfo::values(const ProKey &v)
|
||||||
{ return vars[v]; }
|
{ return vars[v]; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user