configure.bat: Fix errors on Windows

Since the last change to configure.bat we got two of these errors,
regardless of the arguments passed to configure:
    The system cannot find the drive specified.

This is due to the quirky semantics of the :: commenting style that's
used within an if block. Lines starting with :: might be interpreted as
starting with a drive letter.

Switch to rem for comments to avoid such behavior.

Note that we have to quote the comments, because
    rem https://www.example.com/?foo=bar
will split the command at the equal sign and complain about
'unexpected bar'.

Mind-boggling trivia:
    rem https://www.example.com/?something_without_equal
will display the help text for the REM built-in, because /? is somewhere
in the string.

Change-Id: I2ffcc6bd4312d24bdde2b7f1e336f827f503e491
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 073185ad2e29e565bc9f804dc8c1d278121020d6)
This commit is contained in:
Joerg Bornemann 2024-03-01 11:45:10 +01:00 committed by Orgad Shaneh
parent d543c532c2
commit 07fd46969a

View File

@ -83,11 +83,11 @@ set REDO_FILE_PATH=%TOPQTDIR%\config.redo.last
set REDO_TMP_FILE_PATH=%TOPQTDIR%\config.redo.in set REDO_TMP_FILE_PATH=%TOPQTDIR%\config.redo.in
set FRESH_REQUESTED_ARG= set FRESH_REQUESTED_ARG=
if not defined redoing ( if not defined redoing (
:: The '.' in 'echo.%*' ensures we don't print "echo is off" when no arguments are passed rem "The '.' in 'echo.%*' ensures we don't print "echo is off" when no arguments are passed"
:: https://devblogs.microsoft.com/oldnewthing/20170802-00/?p=96735 rem "https://devblogs.microsoft.com/oldnewthing/20170802-00/?p=96735"
:: The space before the '>' makes sure that when we have a digit at the end of the args, we rem "The space before the '>' makes sure that when we have a digit at the end of the args, we"
:: don't accidentally concatenate it with the '>' resulting in '0>' or '2>' which redirects rem "don't accidentally concatenate it with the '>' resulting in '0>' or '2>' which redirects"
:: into the file from a stream different than stdout, leading to broken or empty content. rem "into the file from a stream different than stdout, leading to broken or empty content."
echo.%* >"%OPT_TMP_FILE_PATH%" echo.%* >"%OPT_TMP_FILE_PATH%"
cmake -DIN_FILE="%OPT_TMP_FILE_PATH%" -DOUT_FILE="%OPT_FILE_PATH%" -DIGNORE_ARGS=-top-level -P "%QTSRC%\cmake\QtWriteArgsFile.cmake" cmake -DIN_FILE="%OPT_TMP_FILE_PATH%" -DOUT_FILE="%OPT_FILE_PATH%" -DIGNORE_ARGS=-top-level -P "%QTSRC%\cmake\QtWriteArgsFile.cmake"