Support condition scopes in pro files.

The CONFIG variable was not being checked when testing conditional
scopes. Resulting in, for example, incorrect executable paths when
those paths depend on a particular CONFIG value being set.
This commit is contained in:
Aaron McCarthy
2009-07-02 11:05:01 +10:00
parent 981b1354cc
commit 16286b763d
3 changed files with 38 additions and 8 deletions

View File

@@ -1297,10 +1297,28 @@ bool ProFileEvaluator::Private::isActiveConfig(const QString &config, bool regex
if (Option::target_mode == Option::TARG_WIN_MODE && config == QLatin1String("win32"))
return true;
QRegExp re(config, Qt::CaseSensitive, QRegExp::Wildcard);
QString spec = Option::qmakespec;
if ((regex && re.exactMatch(spec)) || (!regex && spec == config))
return true;
if (regex) {
QRegExp re(config, Qt::CaseSensitive, QRegExp::Wildcard);
if (re.exactMatch(Option::qmakespec))
return true;
// CONFIG variable
foreach (const QString &configValue, m_valuemap.value(QLatin1String("CONFIG"))) {
if (re.exactMatch(configValue))
return true;
}
} else {
// mkspecs
if (Option::qmakespec == config)
return true;
// CONFIG variable
foreach (const QString &configValue, m_valuemap.value(QLatin1String("CONFIG"))) {
if (configValue == config)
return true;
}
}
return false;
}