qmake: let discard_from() discard function definitions as well
for completeness. Change-Id: I3ffc14e041408c773e277442828170e3df04ec8d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
cff05b398c
commit
965e861e61
@ -1365,6 +1365,18 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
}
|
}
|
||||||
++vit;
|
++vit;
|
||||||
}
|
}
|
||||||
|
for (auto fit = m_functionDefs.testFunctions.begin(); fit != m_functionDefs.testFunctions.end(); ) {
|
||||||
|
if (fit->pro() == pro)
|
||||||
|
fit = m_functionDefs.testFunctions.erase(fit);
|
||||||
|
else
|
||||||
|
++fit;
|
||||||
|
}
|
||||||
|
for (auto fit = m_functionDefs.replaceFunctions.begin(); fit != m_functionDefs.replaceFunctions.end(); ) {
|
||||||
|
if (fit->pro() == pro)
|
||||||
|
fit = m_functionDefs.replaceFunctions.erase(fit);
|
||||||
|
else
|
||||||
|
++fit;
|
||||||
|
}
|
||||||
pro->deref();
|
pro->deref();
|
||||||
return ReturnTrue;
|
return ReturnTrue;
|
||||||
}
|
}
|
||||||
|
@ -2326,8 +2326,14 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
|
|||||||
<< true;
|
<< true;
|
||||||
|
|
||||||
QTest::newRow("discard_from()")
|
QTest::newRow("discard_from()")
|
||||||
<< "HERE = 1\nPLUS = one\ninclude(include/inc.pri)\ndiscard_from(include/inc.pri): OK = 1"
|
<< "HERE = 1\nPLUS = one\n"
|
||||||
<< "OK = 1\nHERE = 1\nPLUS = one\nVAR = UNDEF"
|
"defineTest(tfunc) {}\ndefineReplace(rfunc) {}\n"
|
||||||
|
"include(include/inc.pri)\n"
|
||||||
|
"discard_from(include/inc.pri): OK = 1\n"
|
||||||
|
"defined(tfunc, test): TDEF = 1\ndefined(rfunc, replace): RDEF = 1\n"
|
||||||
|
"defined(func, test): DTDEF = 1\ndefined(func, replace): DRDEF = 1\n"
|
||||||
|
<< "OK = 1\nHERE = 1\nPLUS = one\nVAR = UNDEF\n"
|
||||||
|
"TDEF = 1\nRDEF = 1\nDTDEF = UNDEF\nDRDEF = UNDEF"
|
||||||
<< ""
|
<< ""
|
||||||
<< true;
|
<< true;
|
||||||
|
|
||||||
|
@ -8,3 +8,7 @@ fake-*: MATCH = 1
|
|||||||
defineTest(func) {
|
defineTest(func) {
|
||||||
message("say hi!")
|
message("say hi!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineReplace(func) {
|
||||||
|
return("say hi!")
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user