Skip to content

Commit

Permalink
Retrieve an old -redo behavior
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
amirmasoudabdol committed Feb 7, 2023
1 parent 04a3e41 commit 60c8a68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down

0 comments on commit 60c8a68

Please sign in to comment.