diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-11-11 14:45:48 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-11-15 22:44:27 +0000 |
commit | c05f0a83fdb4823604d76f61bb884e206887e704 (patch) | |
tree | baae2867e4fca9b7d8e2f55d31fb2a5330b3a2fa | |
parent | 965e861e61ec56c91216d483987d33fb5a508b85 (diff) |
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>
-rw-r--r-- | qmake/library/qmakebuiltins.cpp | 4 | ||||
-rw-r--r-- | tests/auto/tools/qmakelib/evaltest.cpp | 4 |
2 files changed, 7 insertions, 1 deletions
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; |