diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 47c60271c8..9daa7ada10 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -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: diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp index 614568ee53..44c82fb376 100644 --- a/tests/auto/tools/qmakelib/evaltest.cpp +++ b/tests/auto/tools/qmakelib/evaltest.cpp @@ -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;