Commit caedef35 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

fix conditionals on the qmakespec

- match just the spec name without a possible path
- resolve the default spec
parent e0e4c4d3
......@@ -1307,6 +1307,25 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitProFile(ProFile *pro)
evaluateFileInto(m_option->cachefile,
&m_option->base_valuemap, &m_option->base_functions);
}
m_option->qmakespec_name = IoUtils::fileName(m_option->qmakespec).toString();
if (m_option->qmakespec_name == QLatin1String("default")) {
#ifdef Q_OS_UNIX
char buffer[1024];
int l = ::readlink(m_option->qmakespec.toLatin1().constData(), buffer, 1024);
if (l != -1)
m_option->qmakespec_name =
IoUtils::fileName(QString::fromLatin1(buffer, l)).toString();
#else
// We can't resolve symlinks as they do on Unix, so configure.exe puts
// the source of the qmake.conf at the end of the default/qmake.conf in
// the QMAKESPEC_ORG variable.
const QStringList &spec_org =
m_option->base_valuemap.value(QLatin1String("QMAKESPEC_ORIGINAL"));
if (!spec_org.isEmpty())
m_option->qmakespec_name =
IoUtils::fileName(spec_org.first()).toString();
#endif
}
}
evaluateFeatureFile(QLatin1String("default_pre.prf"),
......@@ -1819,7 +1838,7 @@ bool ProFileEvaluator::Private::isActiveConfig(const QString &config, bool regex
if (regex && (config.contains(QLatin1Char('*')) || config.contains(QLatin1Char('?')))) {
QRegExp re(config, Qt::CaseSensitive, QRegExp::Wildcard);
if (re.exactMatch(m_option->qmakespec))
if (re.exactMatch(m_option->qmakespec_name))
return true;
// CONFIG variable
......@@ -1829,7 +1848,7 @@ bool ProFileEvaluator::Private::isActiveConfig(const QString &config, bool regex
}
} else {
// mkspecs
if (m_option->qmakespec == config)
if (m_option->qmakespec_name == config)
return true;
// CONFIG variable
......
......@@ -161,6 +161,7 @@ struct ProFileOption
QHash<QString, QStringList> base_valuemap; // Cached results of qmake.conf, .qmake.cache & default_pre.prf
ProFileEvaluator::FunctionDefs base_functions;
QStringList feature_roots;
QString qmakespec_name;
};
QT_END_NAMESPACE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment