qt5base-lts/qmake/generators
Joerg Bornemann 1d3b190425 qmake: Fix overlong command lines for static Qt builds on Windows
Linker response files for the MinGW and Unix makefile generators are
controlled by the variable QMAKE_LINK_OBJECT_MAX.  This variable holds a
number.  If the number of object files passed to the linker exceeds this
number, a linker response file containing object file paths is created.

This heuristic is extremely imprecise.  It doesn't take into account the
length of object file names nor the length of $$OBJECTS_DIR.

Also, when using a static Qt, a big part of the linker command line are
libraries.  A relatively small example can fail to link with "The
command line is too long" on Windows, even with the object files being
in a response file.

The MinGW makefile generator already reads the variable
QMAKE_RESPONSEFILE_THRESHOLD for compiler response files.  Re-use this
variable for the linker response file of the Unix and MinGW makefile
generators.

If QMAKE_RESPONSEFILE_THRESHOLD is set, use it to determine whether to
create a response file.  QMAKE_LINK_OBJECT_MAX is then ignored.  The
response file contains objects and libraries.

If QMAKE_RESPONSEFILE_THRESHOLD is not set, use QMAKE_LINK_OBJECT_MAX to
determine whether to create a response file.  The response file contains
only object files.

QMAKE_LINK_OBJECT_SCRIPT is used in both cases to specify a common base
name of all linker response files.

Pick-to: 6.2 6.3
Task-number: QTBUG-100559
Change-Id: I3c78354fa5ebb1a86438ec804679e0ee776c3f49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-02-21 12:37:19 +01:00
..
mac qmake/Xcode: Mark "Qt Preprocess" build phase as always out of date 2021-12-09 17:28:35 +01:00
unix qmake: Fix overlong command lines for static Qt builds on Windows 2022-02-21 12:37:19 +01:00
win32 qmake: Fix overlong command lines for static Qt builds on Windows 2022-02-21 12:37:19 +01:00
makefile.cpp qmake: Fix overlong command lines for static Qt builds on Windows 2022-02-21 12:37:19 +01:00
makefile.h qmake: Fix overlong command lines for static Qt builds on Windows 2022-02-21 12:37:19 +01:00
makefiledeps.cpp qmake: Scan source files with QFile 2022-02-02 18:43:40 +01:00
makefiledeps.h Use QList instead of QVector in qmake 2020-09-05 07:07:44 +02:00
metamakefile.cpp QFileInfo: mark constructors as explicit 2020-11-15 18:30:16 +01:00
metamakefile.h qmake: Apply modernize-use-nullptr 2018-08-08 17:30:32 +00:00
projectgenerator.cpp Use QList instead of QVector in qmake 2020-09-05 07:07:44 +02:00
projectgenerator.h Merge remote-tracking branch 'origin/5.13' into dev 2019-06-14 13:45:18 +02:00
xmloutput.cpp Use qsizetype in QList 2020-07-06 21:31:14 +02:00
xmloutput.h