Retrieve an old -redo behavior

It is not possible to manually edit the `config.opt` and do a redo, and
`configure/` uses the `config.opt` in this case.

Task-number: QTBUG-108287
Change-Id: I3d87b13a900b97fb50e49a4f155bec964ecb5d1a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Amir Masoud Abdol 2023-02-03 14:38:37 +01:00
parent 04a3e411ec
commit 60c8a68746
2 changed files with 7 additions and 5 deletions

8
configure vendored
View File

@ -148,11 +148,9 @@ if [ -z "$optfile" ]; then # only write optfile if not currently redoing
cmake -DIN_FILE="${opttmpfilepath}" -DOUT_FILE="${optfilepath}" -DIGNORE_ARGS=-top-level -P "${relpath}/cmake/QtWriteArgsFile.cmake"
else
# In case config.opt.in is missing for some reason
if [ ! -f "$opttmpfilepath" ]; then
> "$opttmpfilepath"
for arg in `cat $optfile`; do echo \"$arg\" >> "$opttmpfilepath"; done
fi
# Rewriting config.opt into config.opt.in anyway. Allows for direct manipulation of config.opt
> "$opttmpfilepath"
for arg in `cat $optfile`; do echo \"$arg\" >> "$opttmpfilepath"; done
cmake -DIN_FILE="${opttmpfilepath}" -DREDO_FILE="${redotmpfilepath}" -DOUT_FILE="${redofilepath}" -DIGNORE_ARGS=-top-level -P "${relpath}/cmake/QtWriteArgsFile.cmake"
optfilepath=${redofilepath}

View File

@ -84,8 +84,12 @@ set REDO_TMP_FILE_PATH=%TOPQTDIR%\config.redo.in
set FRESH_REQUESTED_ARG=
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 (
echo. 2> "%OPT_TMP_FILE_PATH%"
for /F "usebackq tokens=*" %%A in ("%OPT_FILE_PATH%") do echo "%%A" >> "%OPT_TMP_FILE_PATH%"
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%