Sandboxie/SandboxiePlus/qmake_plus.cmd

134 lines
5.0 KiB
Batchfile
Raw Normal View History

2021-10-16 16:19:51 +01:00
REM @echo off
REM echo Current dir: %cd%
REM echo folder: %~dp0
REM echo arch: %1
2024-06-04 18:29:19 +01:00
REM echo qt_version: %2
REM echo qt6_version: %3
2021-10-16 16:19:51 +01:00
2024-06-04 18:29:19 +01:00
echo %*
IF "%~3" == "" ( set "qt6_version=6.3.1" ) ELSE ( set "qt6_version=%~3" )
IF "%~2" == "" ( set "qt_version=5.15.14" ) ELSE ( set "qt_version=%~2" )
2021-10-16 16:19:51 +01:00
IF %1 == Win32 (
2024-06-04 18:29:19 +01:00
set qt_path=%~dp0..\..\Qt\%qt_version%\msvc2019
2022-11-12 10:23:22 +00:00
REM get private headers for QtCore
2024-06-04 18:29:19 +01:00
Xcopy /E /I /Y /Q %~dp0..\..\Qt\%qt_version%\msvc2019\include\QtCore\%qt_version%\QtCore %~dp0..\..\Qt\%qt_version%\msvc2019\include\QtCore
2022-11-12 10:23:22 +00:00
2021-10-16 16:19:51 +01:00
set build_arch=Win32
2022-10-12 20:13:44 +01:00
set qt_params=
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
2021-10-16 16:19:51 +01:00
)
IF %1 == x64 (
2024-06-04 18:29:19 +01:00
set qt_path=%~dp0..\..\Qt\%qt_version%\msvc2019_64
REM set qt_path=%~dp0..\..\Qt\%qt6_version%\msvc2019_64
2022-11-12 10:23:22 +00:00
REM get private headers for QtCore
2024-06-04 18:29:19 +01:00
Xcopy /E /I /Y /Q %~dp0..\..\Qt\%qt_version%\msvc2019_64\include\QtCore\%qt_version%\QtCore %~dp0..\..\Qt\%qt_version%\msvc2019_64\include\QtCore
REM Xcopy /E /I /Y /Q %~dp0..\..\Qt\%qt6_version%\msvc2019_64\include\QtCore\%qt6_version%\QtCore %~dp0..\..\Qt\%qt6_version%\msvc2019_64\include\QtCore
2022-11-12 10:23:22 +00:00
2021-10-16 16:19:51 +01:00
set build_arch=x64
2022-10-12 20:13:44 +01:00
set qt_params=
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
)
IF %1 == ARM64 (
2024-06-04 18:29:19 +01:00
set qt_path=%~dp0..\..\Qt\%qt6_version%\msvc2019_64
2022-11-12 10:23:22 +00:00
REM get private headers for QtCore
2024-06-04 18:29:19 +01:00
Xcopy /E /I /Y /Q %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\include\QtCore\%qt6_version%\QtCore %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\include\QtCore
2022-11-12 10:23:22 +00:00
2022-10-12 20:13:44 +01:00
set build_arch=ARM64
2024-06-04 18:29:19 +01:00
REM set qt_params=-qtconf "%~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\target_qt.conf"
2022-10-12 20:13:44 +01:00
2024-06-04 18:29:19 +01:00
REM type %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\target_qt.conf
2022-10-12 20:13:44 +01:00
REM
REM The target_qt.conf as provided by the windows-2019 github action runner
REM is non functional, hence we create our own working edition here.
REM
2024-06-04 18:29:19 +01:00
echo [DevicePaths] > %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo Prefix=C:/Qt/Qt-%qt6_version% >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo [Paths] >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo Prefix=../ >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo HostPrefix=../../msvc2019_64 >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo HostData=../msvc2019_arm64 >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo Sysroot= >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo SysrootifyPrefix=false >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo TargetSpec=win32-arm64-msvc >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo HostSpec=win32-msvc >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo Documentation=../../Docs/Qt-%qt6_version% >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
echo Examples=../../Examples/Qt-%qt6_version% >> %~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf
2022-10-12 20:13:44 +01:00
2024-06-04 18:29:19 +01:00
set qt_params=-qtconf "%~dp0..\..\Qt\%qt6_version%\msvc2019_arm64\bin\my_target_qt.conf"
2022-10-12 20:13:44 +01:00
REM set VSCMD_DEBUG=3
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
2021-10-16 16:19:51 +01:00
)
2022-10-12 20:13:44 +01:00
@echo on
2021-10-16 16:19:51 +01:00
mkdir %~dp0\Build_UGlobalHotkey_%build_arch%
cd %~dp0\Build_UGlobalHotkey_%build_arch%
2022-10-12 20:13:44 +01:00
%qt_path%\bin\qmake.exe %~dp0\UGlobalHotkey\uglobalhotkey.qc.pro %qt_params%
2021-10-16 16:19:51 +01:00
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
IF %ERRORLEVEL% NEQ 0 goto :error
if NOT EXIST %~dp0\bin\%build_arch%\Release\UGlobalHotkey.dll goto :error
mkdir %~dp0\Build_qtsingleapp_%build_arch%
cd %~dp0\Build_qtsingleapp_%build_arch%
2022-10-12 20:13:44 +01:00
%qt_path%\bin\qmake.exe %~dp0\QtSingleApp\qtsingleapp\qtsingleapp\qtsingleapp.qc.pro %qt_params%
2021-10-16 16:19:51 +01:00
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
IF %ERRORLEVEL% NEQ 0 goto :error
if NOT EXIST %~dp0\bin\%build_arch%\Release\qtsingleapp.dll goto :error
mkdir %~dp0\Build_MiscHelpers_%build_arch%
cd %~dp0\Build_MiscHelpers_%build_arch%
2022-10-12 20:13:44 +01:00
%qt_path%\bin\qmake.exe %~dp0\MiscHelpers\MiscHelpers.qc.pro %qt_params%
2021-10-16 16:19:51 +01:00
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
IF %ERRORLEVEL% NEQ 0 goto :error
if NOT EXIST %~dp0\bin\%build_arch%\Release\MiscHelpers.dll goto :error
mkdir %~dp0\Build_QSbieAPI_%build_arch%
cd %~dp0\Build_QSbieAPI_%build_arch%
2022-10-12 20:13:44 +01:00
%qt_path%\bin\qmake.exe %~dp0\QSbieAPI\QSbieAPI.qc.pro %qt_params%
2021-10-16 16:19:51 +01:00
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
IF %ERRORLEVEL% NEQ 0 goto :error
if NOT EXIST %~dp0\bin\%build_arch%\Release\QSbieAPI.dll goto :error
mkdir %~dp0\Build_SandMan_%build_arch%
cd %~dp0\Build_SandMan_%build_arch%
2022-10-12 20:13:44 +01:00
%qt_path%\bin\qmake.exe %~dp0\SandMan\SandMan.qc.pro %qt_params%
2021-10-16 16:19:51 +01:00
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
IF %ERRORLEVEL% NEQ 0 goto :error
if NOT EXIST %~dp0\bin\%build_arch%\Release\SandMan.exe goto :error
cd %~dp0
rem dir .\bin
rem dir .\bin\%build_arch%
rem dir .\bin\%build_arch%\Release
goto :eof
:error
echo Build failed
exit 1