From d27ccf4d983bc407ce52b9fc73df9d682da1bcea Mon Sep 17 00:00:00 2001 From: Miguel Costa Date: Mon, 14 Oct 2019 00:01:09 +0200 Subject: Fix "command too long" error with static build of Qt Fixed a problem where using a static build of Qt would generate a "command too long" error. This error was generated when setting up the build properties that correspond to qmake variables. Task-number: QTVSADDINBUG-671 Change-Id: Id4118d6ae169e480595c18a077af8379acb6ba98 Reviewed-by: Oliver Wolff --- src/qtmsbuild/qt_vars.targets | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/qtmsbuild/qt_vars.targets b/src/qtmsbuild/qt_vars.targets index 8cf3f06c..98bbd42e 100644 --- a/src/qtmsbuild/qt_vars.targets +++ b/src/qtmsbuild/qt_vars.targets @@ -203,19 +203,22 @@ defined(modules, var) { # contains(varNames, LIBS) { varNames -= LIBS - nop = "(ECHO>NUL)" - qtvars.target = qtvars - qtvars.commands = CMD /V:ON /C \ - \"@ECHO OFF &\ - SET VALUE= &\ - (FOR %%x IN (%24(LIBS)) DO (\ - SET y=%%x&\ - IF NOT \"!y:~0,9!\"==\"/LIBPATH:\"\ - SET VALUE=!y!%3B!VALUE!& $$nop \ - ))&\ - SET PROP=^!VALUE:~0,-2!^&\ - ECHO !PROP!>>$$fileName&\" + NL = $$escape_expand("\n") + TAB = $$escape_expand("\t") QMAKE_EXTRA_TARGETS += qtvars + qtvars.target = qtvars + qtvars.depends = %24(LIBS) + qtvars.commands = \ +$$NL%24(LIBS): FORCE\ +$$NL$$TAB@CMD /V:ON /C \"\ + @ECHO OFF &\ + SET x=$@&\ + IF NOT \"!x:~0,9!\"==\"/LIBPATH:\" (\ + ECHO ^\%24\%24^(Qt_LIBS_^)%3B!x!^>>$$fileName\ + )\ + ELSE (\ + ECHO ^\%24\%24^(Qt_LIBPATH_^)%3B!x:~9!^>>$$fileName\ + )\" } ## Append Qt variables to .props (XML) file -- cgit v1.2.3