From 07fd46969a1237348e5979a9b687467a68f1be3a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 1 Mar 2024 11:45:10 +0100 Subject: [PATCH] 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 (cherry picked from commit 073185ad2e29e565bc9f804dc8c1d278121020d6) --- configure.bat | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.bat b/configure.bat index 972f16594c3..0c22fdccca3 100644 --- a/configure.bat +++ b/configure.bat @@ -83,11 +83,11 @@ set REDO_FILE_PATH=%TOPQTDIR%\config.redo.last set REDO_TMP_FILE_PATH=%TOPQTDIR%\config.redo.in set FRESH_REQUESTED_ARG= if not defined redoing ( - :: 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 - :: 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 - :: into the file from a stream different than stdout, leading to broken or empty content. + rem "The '.' in 'echo.%*' ensures we don't print "echo is off" when no arguments are passed" + rem "https://devblogs.microsoft.com/oldnewthing/20170802-00/?p=96735" + rem "The space before the '>' makes sure that when we have a digit at the end of the args, we" + rem "don't accidentally concatenate it with the '>' resulting in '0>' or '2>' which redirects" + rem "into the file from a stream different than stdout, leading to broken or empty content." 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"