support alternative and multiple suffixes in $$resolve_depends()
this is undeniably a new feature, but it's needed for a bugfix. Change-Id: I951a3128eb580404ee0c7e3cdcb4d6170e899f70 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
parent
513971eecd
commit
8705480587
@ -382,14 +382,16 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QMakeEvaluator::populateDeps(
|
void QMakeEvaluator::populateDeps(
|
||||||
const ProStringList &deps, const ProString &prefix,
|
const ProStringList &deps, const ProString &prefix, const ProStringList &suffixes,
|
||||||
QHash<ProKey, QSet<ProKey> > &dependencies, ProValueMap &dependees,
|
QHash<ProKey, QSet<ProKey> > &dependencies, ProValueMap &dependees,
|
||||||
ProStringList &rootSet) const
|
ProStringList &rootSet) const
|
||||||
{
|
{
|
||||||
foreach (const ProString &item, deps)
|
foreach (const ProString &item, deps)
|
||||||
if (!dependencies.contains(item.toKey())) {
|
if (!dependencies.contains(item.toKey())) {
|
||||||
QSet<ProKey> &dset = dependencies[item.toKey()]; // Always create entry
|
QSet<ProKey> &dset = dependencies[item.toKey()]; // Always create entry
|
||||||
ProStringList depends = values(ProKey(prefix + item + QString::fromLatin1(".depends")));
|
ProStringList depends;
|
||||||
|
foreach (const ProString &suffix, suffixes)
|
||||||
|
depends += values(ProKey(prefix + item + suffix));
|
||||||
if (depends.isEmpty()) {
|
if (depends.isEmpty()) {
|
||||||
rootSet << item;
|
rootSet << item;
|
||||||
} else {
|
} else {
|
||||||
@ -397,7 +399,7 @@ void QMakeEvaluator::populateDeps(
|
|||||||
dset.insert(dep.toKey());
|
dset.insert(dep.toKey());
|
||||||
dependees[dep.toKey()] << item;
|
dependees[dep.toKey()] << item;
|
||||||
}
|
}
|
||||||
populateDeps(depends, prefix, dependencies, dependees, rootSet);
|
populateDeps(depends, prefix, suffixes, dependencies, dependees, rootSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -913,14 +915,17 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
break;
|
break;
|
||||||
case E_SORT_DEPENDS:
|
case E_SORT_DEPENDS:
|
||||||
case E_RESOLVE_DEPENDS:
|
case E_RESOLVE_DEPENDS:
|
||||||
if (args.count() < 1 || args.count() > 2) {
|
if (args.count() < 1 || args.count() > 3) {
|
||||||
evalError(fL1S("%1(var, prefix) requires one or two arguments.").arg(func.toQString(m_tmp1)));
|
evalError(fL1S("%1(var, [prefix, [suffixes]]) requires one to three arguments.")
|
||||||
|
.arg(func.toQString(m_tmp1)));
|
||||||
} else {
|
} else {
|
||||||
QHash<ProKey, QSet<ProKey> > dependencies;
|
QHash<ProKey, QSet<ProKey> > dependencies;
|
||||||
ProValueMap dependees;
|
ProValueMap dependees;
|
||||||
ProStringList rootSet;
|
ProStringList rootSet;
|
||||||
ProStringList orgList = values(args.at(0).toKey());
|
ProStringList orgList = values(args.at(0).toKey());
|
||||||
populateDeps(orgList, (args.count() < 2 ? ProString() : args.at(1)),
|
populateDeps(orgList, (args.count() < 2 ? ProString() : args.at(1)),
|
||||||
|
args.count() < 3 ? ProStringList(ProString(".depends"))
|
||||||
|
: split_value_list(args.at(2).toQString(m_tmp2)),
|
||||||
dependencies, dependees, rootSet);
|
dependencies, dependees, rootSet);
|
||||||
for (int i = 0; i < rootSet.size(); ++i) {
|
for (int i = 0; i < rootSet.size(); ++i) {
|
||||||
const ProString &item = rootSet.at(i);
|
const ProString &item = rootSet.at(i);
|
||||||
|
@ -219,7 +219,7 @@ public:
|
|||||||
bool isActiveConfig(const QString &config, bool regex = false);
|
bool isActiveConfig(const QString &config, bool regex = false);
|
||||||
|
|
||||||
void populateDeps(
|
void populateDeps(
|
||||||
const ProStringList &deps, const ProString &prefix,
|
const ProStringList &deps, const ProString &prefix, const ProStringList &suffixes,
|
||||||
QHash<ProKey, QSet<ProKey> > &dependencies,
|
QHash<ProKey, QSet<ProKey> > &dependencies,
|
||||||
ProValueMap &dependees, ProStringList &rootSet) const;
|
ProValueMap &dependees, ProStringList &rootSet) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user