qmake/MinGW: Fix linking target name with whitespace

When having a TARGET value that contains whitespace, linking would fail
with MinGW.  This was, because the function createResponseFile stitched
together a file name like this:
    objectScript."Target Name".Release

The inner double quotes make the file name invalid.

Fix this by retrieving QMAKE_ORIG_TARGET with the var() method instead
of fileVar().  The latter quotes the return value if it contains
spaces.

Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-99522
Change-Id: Ieb7dcf3fbbd8a75de5a9b9a6beadb2170dddf35d
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
Joerg Bornemann 2022-01-04 14:30:46 +01:00
parent 4545d7d6a6
commit 7246058dfd

View File

@ -3497,7 +3497,7 @@ QString MakefileGenerator::createResponseFile(
const ProStringList &objList,
const QString &prefix)
{
QString fileName = baseName + '.' + fileVar("QMAKE_ORIG_TARGET");
QString fileName = baseName + '.' + var("QMAKE_ORIG_TARGET");
if (!var("BUILD_NAME").isEmpty())
fileName += '.' + var("BUILD_NAME");
if (!var("MAKEFILE").isEmpty())