QMake: Exit with an error if include() fails
When include() could not read its file, qmake printed an error
message but exited with 0, so that a broken project looked
successful to scripts and to make, which regenerates Makefiles by
running qmake.
Remember such a failure and exit with 3 after processing the
project, as for other project errors. The Makefile is still written.
There are two exceptions:
- The silent argument, include(file, , true), suppresses the message
and the error.
- A failure whose result is used as a condition, as in
!include(file) { ... }, is handled by the project. This is the
usage that the documentation shows.
Fixes: QTBUG-44800
Change-Id: I9319c36d9975b26feb183f694e4a1a8e75ba87eb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| commit | 0b047117b43e2928f096a2415b01bc562dae72bd |
| parent | d6fafbcad765daa5cd83d03d0e7375d882f0ea7d |
| author | Joerg Bornemann <joerg.bornemann@qt.io> |
| committer | Joerg Bornemann <joerg.bornemann@qt.io> |
| commit time | Wed, 21 Oct 2026 21:24:34 +0000 |
- M qmake/doc/src/qmake-manual.qdoc
- M qmake/library/qmakebuiltins.cpp
- M qmake/library/qmakeevaluator.cpp
- M qmake/library/qmakeevaluator.h
- M qmake/library/qmakeglobals.h
- M qmake/main.cpp
- M tests/auto/tools/qmake/testcompiler.cpp
- M tests/auto/tools/qmake/testcompiler.h
- A tests/auto/tools/qmake/testdata/include_missing/handled.pro
- A tests/auto/tools/qmake/testdata/include_missing/missing.pro
- A tests/auto/tools/qmake/testdata/include_missing/scoped.pro
- A tests/auto/tools/qmake/testdata/include_missing/silent.pro
- M tests/auto/tools/qmake/tst_qmake.cpp