Skip to content

Commit

Permalink
QMake: Fix quoting of WASM's ASYNCIFY_IMPORTS linker option
Browse files Browse the repository at this point in the history
WASM projects failed to link on Windows if "CONFIG += silent" was
specified in the .pro file and the build environment did not contain
sh.exe.

In that case, QMake prepends "@echo linking && " to the link command.
The mingw32-make tool then considers this command as "complex command"
and runs it through either sh.exe or cmd.exe, depending on whether
sh.exe is found in PATH. If cmd.exe is used, the single quotes around
the ASYNCIFY_IMPORTS option are passed verbatim to em++. Then em++
thinks 'ASYNCIFY_IMPORTS=qt_asyncify_suspend_js,qt_asyncify_resume_js'
is an input file. That file is of course non-existent, and linking
fails.

Remove the single quotes around the linker option. They are not
necessary.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-122192
Change-Id: Id362b51ac787f7f235bcb3d9102c5dee66ce5768
Reviewed-by: Alexandru Croitor <[email protected]>
Reviewed-by:  Alexey Edelev <[email protected]>
  • Loading branch information
jobor committed Feb 19, 2024
1 parent f54d222 commit 9c56c1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mkspecs/common/wasm/wasm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ load(emcc_ver)
}

# Declare async functions
QMAKE_LFLAGS += -s \'ASYNCIFY_IMPORTS=qt_asyncify_suspend_js,qt_asyncify_resume_js\'
QMAKE_LFLAGS += -s ASYNCIFY_IMPORTS=qt_asyncify_suspend_js,qt_asyncify_resume_js

EMCC_COMMON_LFLAGS += \
-s WASM=1 \
Expand Down

0 comments on commit 9c56c1f

Please sign in to comment.