diff options
author | Amir Masoud Abdol <amirmasoudabdol@icloud.com> | 2022-11-18 11:31:02 +0100 |
---|---|---|
committer | Amir Masoud Abdol <amirmasoudabdol@icloud.com> | 2023-01-19 13:19:20 +0100 |
commit | 5c40cb0f1a8fad03edb3ef0f97df15e9dd643bdf (patch) | |
tree | 07e17170fa6ace6ca0bf79f3a16dcc192a5dc7ba /configure.bat | |
parent | e3f230e7be445b9cabaf1c8556bb97994813e205 (diff) |
Fix a bug in -redo where -redo was not considering new options
In addition to the fix, I've removed some legacy codes in the
`configure` file and delegated most of the work to
the `QtWriteArgsFile.cmake` which was being used by `configure.bat`. I
am not sure how this was supposed to work before since it was not really
working, but now, `config.opt` lives in the build directory, together
with `config.opt.in` (a template file), and the `config.redo` (and
`config.redo.in`) which holds the full redo command. The template files
are being used to preserve the quoted variables and to help
QtWriteArgFiles process the opt files more consistency.
Also fixed an issue on Unix, where ./configure was failing to run if
its path contained spaces, e.g., `Qt Src/qt5/configure`.
Fixes: QTBUG-108287
Change-Id: I9843b690a1fd3177a93e55e08a3484a4c85ba2e8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'configure.bat')
-rw-r--r-- | configure.bat | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/configure.bat b/configure.bat index e93e0af318..f3176d3e7a 100644 --- a/configure.bat +++ b/configure.bat @@ -65,9 +65,8 @@ goto doneargs :redo if not exist "%TOPQTDIR%\config.opt" goto redoerr - set rargs= - for /f "usebackq delims=" %%i in ("%TOPQTDIR%\config.opt") do set rargs=!rargs! "%%i" - call :doargs %rargs% + echo %ARGS% > %TOPQTDIR%\config.redo.in + set redoing="" goto nextarg :redoerr echo No config.opt present - cannot redo configuration. >&2 @@ -78,15 +77,22 @@ goto doneargs cd "%TOPQTDIR%" rem Write config.opt if we're not currently -redo'ing +set OPT_FILE_PATH=%TOPQTDIR%\config.opt +set OPT_TMP_FILE_PATH=%TOPQTDIR%\config.opt.in +set REDO_FILE_PATH=%TOPQTDIR%\config.redo +set REDO_TMP_FILE_PATH=%TOPQTDIR%\config.redo.in set FRESH_REQUESTED_ARG= -if "!rargs!" == "" ( - echo.%*>config.opt.in - cmake -DIN_FILE=config.opt.in -DOUT_FILE=config.opt -DIGNORE_ARGS=-top-level -P "%QTSRC%\cmake\QtWriteArgsFile.cmake" -) else if NOT "!rargs!" == "" ( +if not defined redoing ( + 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" +) else ( + cmake -DIN_FILE="%OPT_TMP_FILE_PATH%" -DREDO_FILE="%REDO_TMP_FILE_PATH%" -DOUT_FILE="%REDO_FILE_PATH%" -DIGNORE_ARGS="-top-level;-redo;--redo" -P "%QTSRC%\cmake\QtWriteArgsFile.cmake" + + set OPT_FILE_PATH=%REDO_FILE_PATH% set FRESH_REQUESTED_ARG=-DFRESH_REQUESTED=TRUE ) rem Launch CMake-based configure set TOP_LEVEL_ARG= if %TOPLEVEL% == true set TOP_LEVEL_ARG=-DTOP_LEVEL=TRUE -cmake -DOPTFILE=config.opt %TOP_LEVEL_ARG% %FRESH_REQUESTED_ARG% -P "%QTSRC%\cmake\QtProcessConfigureArgs.cmake" +cmake -DOPTFILE="%OPT_FILE_PATH%" %TOP_LEVEL_ARG% %FRESH_REQUESTED_ARG% -P "%QTSRC%\cmake\QtProcessConfigureArgs.cmake" |