summaryrefslogtreecommitdiffstats
path: root/configure.bat
diff options
context:
space:
mode:
Diffstat (limited to 'configure.bat')
-rw-r--r--configure.bat75
1 files changed, 26 insertions, 49 deletions
diff --git a/configure.bat b/configure.bat
index 43ecea2bea..0c22fdccca 100644
--- a/configure.bat
+++ b/configure.bat
@@ -1,31 +1,6 @@
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-::
:: Copyright (C) 2016 The Qt Company Ltd.
:: Copyright (C) 2016 Intel Corporation.
-:: Contact: https://www.qt.io/licensing/
-::
-:: This file is part of the tools applications of the Qt Toolkit.
-::
-:: $QT_BEGIN_LICENSE:GPL-EXCEPT$
-:: Commercial License Usage
-:: Licensees holding valid commercial Qt licenses may use this file in
-:: accordance with the commercial license agreement provided with the
-:: Software or, alternatively, in accordance with the terms contained in
-:: a written agreement between you and The Qt Company. For licensing terms
-:: and conditions see https://www.qt.io/terms-conditions. For further
-:: information use the contact form at https://www.qt.io/contact-us.
-::
-:: GNU General Public License Usage
-:: Alternatively, this file may be used under the terms of the GNU
-:: General Public License version 3 as published by the Free Software
-:: Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-:: included in the packaging of this file. Please review the following
-:: information to ensure the GNU General Public License requirements will
-:: be met: https://www.gnu.org/licenses/gpl-3.0.html.
-::
-:: $QT_END_LICENSE$
-::
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: SPDX-License-Identifier: BSD-3-Clause
@echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
@@ -53,10 +28,6 @@ echo ERROR: You cannot configure qtbase separately within a top-level build. >&2
exit /b 1
:wastoplevel
-set SYNCQT=
-set PLATFORM=
-set MAKE=
-set CMAKE=true
call :doargs %ARGS%
if errorlevel 1 exit /b
goto doneargs
@@ -75,12 +46,6 @@ goto doneargs
if /i "%~1" == "-redo" goto redo
if /i "%~1" == "--redo" goto redo
- if /i "%~1" == "-cmake" goto cmake
- if /i "%~1" == "--cmake" goto cmake
-
- if /i "%~1" == "-qmake" goto qmake
- if /i "%~1" == "--qmake" goto qmake
-
:nextarg
shift
goto doargs
@@ -100,31 +65,43 @@ 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
exit /b 1
-:cmake
- goto nextarg
-
-:qmake
- echo ERROR: You cannot configure Qt 6 with qmake anymore. >&2
- exit /b 1
-
:doneargs
cd "%TOPQTDIR%"
rem Write config.opt if we're not currently -redo'ing
-if "%rargs%" == "" (
- cmake -DOUT_FILE=config.opt -DIGNORE_ARGS=-top-level -P "%QTSRC%\cmake\QtWriteArgsFile.cmake" %*
+set OPT_FILE_PATH=%TOPQTDIR%\config.opt
+set OPT_TMP_FILE_PATH=%TOPQTDIR%\config.opt.in
+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 (
+ 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"
+) 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%
+ 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% -P "%QTSRC%\cmake\QtProcessConfigureArgs.cmake"
+cmake -DOPTFILE="%OPT_FILE_PATH%" %TOP_LEVEL_ARG% %FRESH_REQUESTED_ARG% -P "%QTSRC%\cmake\QtProcessConfigureArgs.cmake"