qmake: make discard_from() patch up QMAKE_INTERNAL_INCLUDED_FILES as well

when the file's effects are discarded, the mention of the file should be
as well.

Change-Id: I894b7e2b887dd34d18533b197bfa9d0d84d647e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-11-11 14:45:48 +01:00
parent 965e861e61
commit c05f0a83fd
2 changed files with 7 additions and 1 deletions

View File

@ -1378,6 +1378,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
++fit;
}
pro->deref();
ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
int idx = iif.indexOf(ProString(fn));
if (idx >= 0)
iif.removeAt(idx);
return ReturnTrue;
}
case T_INFILE:

View File

@ -2329,10 +2329,12 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
<< "HERE = 1\nPLUS = one\n"
"defineTest(tfunc) {}\ndefineReplace(rfunc) {}\n"
"include(include/inc.pri)\n"
"contains(QMAKE_INTERNAL_INCLUDED_FILES, .*/include/inc\\\\.pri): PRE = 1\n"
"discard_from(include/inc.pri): OK = 1\n"
"!contains(QMAKE_INTERNAL_INCLUDED_FILES, .*/include/inc\\\\.pri): POST = 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"
<< "PRE = 1\nPOST = 1\nOK = 1\nHERE = 1\nPLUS = one\nVAR = UNDEF\n"
"TDEF = 1\nRDEF = 1\nDTDEF = UNDEF\nDRDEF = UNDEF"
<< ""
<< true;