qmake: Enforce linker response files for WebAssembly on Windows

Set QMAKE_REPONSEFILE_THRESHOLD to 1 in the WebAssembly mkspec to
enforce the usage of linker response files.  This fixes "The command
line is too long." errors when linking user projects that depend on many
libraries, for example projects using QtQuickControls2.

Pick-to: 6.2 6.3
Fixes: QTBUG-100559
Change-Id: I2f03f0756c9f171bc7382940fa0f8079bdb75a00
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2022-02-18 09:03:41 +01:00
parent 1d3b190425
commit 95457ba8e7

View File

@ -78,8 +78,7 @@ QMAKE_EXTENSION_STATICLIB = a # llvm bitcode
QMAKE_AR = emar cqs
equals(QMAKE_HOST.os, Windows) {
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
QMAKE_RESPONSEFILE_THRESHOLD = 1
QMAKE_AR_CMD = \
"$(file >$(OBJECTS_DIR)/$(TARGET).rsp, $(subst \\,/,$(OBJECTS)))$$escape_expand(\\n\\t)" \
"$(AR) $(DESTDIR)$(TARGET) @$(OBJECTS_DIR)/$(TARGET).rsp"