Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More build instructions #3092

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions SandboxiePlus/install_jom.cmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
if exist %~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe goto done
@echo off

curl -LsSO --output-dir %~dp0..\..\ https://download.qt.io/official_releases/jom/jom.zip
"C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\Tools\QtCreator\bin\ %~dp0..\..\jom.zip
IF "%1" == "" (
set qt_root_dir=%~dp0..\..\Qt
) ELSE (
set qt_root_dir=%1
)

if exist %qt_root_dir%\Tools\QtCreator\bin\jom.exe (
echo jom already installed, nothing to do
goto done
)

::Check that needed programs exist in path
where /q curl
if %ERRORLEVEL% == 1 (
echo curl.exe not found in path!
exit /b 1
)

where /q 7z
if %ERRORLEVEL% == 1 (
echo 7z.exe not found in path!
exit /b 2
)

curl -LsSO --output-dir %qt_root_dir%\ https://download.qt.io/official_releases/jom/jom.zip
7z x -aoa -o%qt_root_dir%\Tools\QtCreator\bin\ %qt_root_dir%\jom.zip

:done

REM dir %~dp0..\..\
REM dir %~dp0..\..\Qt
REM dir %~dp0..\..\Qt\Tools

echo Success!
::/b terminates the script without closing the CMD
exit /b 0
21 changes: 12 additions & 9 deletions SandboxiePlus/install_qt.cmd
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
set WIN32_QT_VER=5.15.13
set x64_QT_VER=5.15.13

if %1 == Win32 (
if exist %~dp0..\..\Qt\5.15.13\msvc2019\bin\qmake.exe goto done
if exist %~dp0..\..\Qt\%WIN32_QT_VER%\msvc2019\bin\qmake.exe goto done

curl -LsSO --output-dir %~dp0..\..\ https://github.com/xanasoft/qt-builds/releases/download/v5.15.13-lgpl/qt-everywhere-5.15.13-Windows_10-MSVC2019-x86.7z
"C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\ %~dp0..\..\qt-everywhere-5.15.13-Windows_10-MSVC2019-x86.7z
certutil -hashfile %~dp0..\..\qt-everywhere-5.15.13-Windows_10-MSVC2019-x86.7z SHA256 | find /i "59ff4d30a756680f359cc937c78f878c3063510669fea306d48f4f745df952f6"
curl -LsSO --output-dir %~dp0..\..\ https://github.com/xanasoft/qt-builds/releases/download/v%WIN32_QT_VER%-lgpl/qt-everywhere-%WIN32_QT_VER%-Windows_10-MSVC2019-x86.7z
"C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\ %~dp0..\..\qt-everywhere-%WIN32_QT_VER%-Windows_10-MSVC2019-x86.7z
certutil -hashfile %~dp0..\..\qt-everywhere-%WIN32_QT_VER%-Windows_10-MSVC2019-x86.7z SHA256 | find /i "59ff4d30a756680f359cc937c78f878c3063510669fea306d48f4f745df952f6"
)
if %1 == x64 (
if exist %~dp0..\..\Qt\5.15.13\msvc2019_64\bin\qmake.exe goto done
if exist %~dp0..\..\Qt\%x64_QT_VER%\msvc2019_64\bin\qmake.exe goto done

curl -LsSO --output-dir %~dp0..\..\ https://github.com/xanasoft/qt-builds/releases/download/v5.15.13-lgpl/qt-everywhere-5.15.13-Windows_10-MSVC2019-x86_64.7z
"C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\ %~dp0..\..\qt-everywhere-5.15.13-Windows_10-MSVC2019-x86_64.7z
certutil -hashfile %~dp0..\..\qt-everywhere-5.15.13-Windows_10-MSVC2019-x86_64.7z SHA256 | find /i "3d7d7ac9d985c1cec1923fbe4feca630bcf5cc974f28e833d9c191e50906af2c"
curl -LsSO --output-dir %~dp0..\..\ https://github.com/xanasoft/qt-builds/releases/download/v%x64_QT_VER%-lgpl/qt-everywhere-%x64_QT_VER%-Windows_10-MSVC2019-x86_64.7z
"C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\ %~dp0..\..\qt-everywhere-%x64_QT_VER%-Windows_10-MSVC2019-x86_64.7z
certutil -hashfile %~dp0..\..\qt-everywhere-%x64_QT_VER%-Windows_10-MSVC2019-x86_64.7z SHA256 | find /i "3d7d7ac9d985c1cec1923fbe4feca630bcf5cc974f28e833d9c191e50906af2c"
)

if %ERRORLEVEL% == 1 exit /b 1
Expand All @@ -19,4 +22,4 @@ if %ERRORLEVEL% == 1 exit /b 1

REM dir %~dp0..\..\
REM dir %~dp0..\..\Qt
REM dir %~dp0..\..\Qt\5.15.13
REM dir %~dp0..\..\Qt\%x64_QT_VER%
130 changes: 82 additions & 48 deletions SandboxiePlus/qmake_plus.cmd
Original file line number Diff line number Diff line change
@@ -1,128 +1,162 @@
REM @echo off
REM echo Current dir: %cd%
REM echo Current dir: %cd /d%
REM echo folder: %~dp0
REM echo arch: %1

set ORIGINAL_FOLDER=%cd%
set WIN32_QT_VER=5.15.13
set x64_QT_VER=5.15.13
set ARM64_QT_VER=6.3.2

IF %1 == Win32 (
set qt_path=%~dp0..\..\Qt\5.15.13\msvc2019
IF "%3" == "" (
set parallelism=8
) ELSE (
set parallelism=%3
)
set parallelism=-j %parallelism%


IF "%2" == "" (
set qt_root_dir=%~dp0..\..\Qt
) ELSE (
set qt_root_dir=%2
)

REM Print usage if no architecture is specified
IF "%1" == "" (
call :print_usage
exit /b 2
)

IF %1 == Win32 (
set qt_path=%qt_root_dir%\%WIN32_QT_VER%\msvc2019

REM get private headers for QtCore
Xcopy /E /I /Y /Q %~dp0..\..\Qt\5.15.13\msvc2019\include\QtCore\5.15.13\QtCore %~dp0..\..\Qt\5.15.13\msvc2019\include\QtCore
Xcopy /E /I /Y /Q %qt_root_dir%\%WIN32_QT_VER%\msvc2019\include\QtCore\%WIN32_QT_VER%\QtCore %qt_root_dir%\%WIN32_QT_VER%\msvc2019\include\QtCore

set build_arch=Win32
set qt_params=
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
)
IF %1 == x64 (
set qt_path=%~dp0..\..\Qt\5.15.13\msvc2019_64
REM set qt_path=%~dp0..\..\Qt\6.3.1\msvc2019_64
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
) ELSE IF %1 == x64 (
set qt_path=%qt_root_dir%\%x64_QT_VER%\msvc2019_64

REM get private headers for QtCore
Xcopy /E /I /Y /Q %~dp0..\..\Qt\5.15.13\msvc2019_64\include\QtCore\5.15.13\QtCore %~dp0..\..\Qt\5.15.13\msvc2019_64\include\QtCore
REM Xcopy /E /I /Y /Q %~dp0..\..\Qt\6.3.1\msvc2019_64\include\QtCore\6.3.1\QtCore %~dp0..\..\Qt\6.3.1\msvc2019_64\include\QtCore
Xcopy /E /I /Y /Q %qt_root_dir%\%x64_QT_VER%\msvc2019_64\include\QtCore\%x64_QT_VER%\QtCore %qt_root_dir%\%x64_QT_VER%\msvc2019_64\include\QtCore

set build_arch=x64
set qt_params=
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
)
IF %1 == ARM64 (
set qt_path=%~dp0..\..\Qt\6.3.1\msvc2019_64
) ELSE IF %1 == ARM64 (
set qt_path=%qt_root_dir%\%ARM64_QT_VER%\msvc2019_64

REM get private headers for QtCore
Xcopy /E /I /Y /Q %~dp0..\..\Qt\6.3.1\msvc2019_arm64\include\QtCore\6.3.1\QtCore %~dp0..\..\Qt\6.3.1\msvc2019_arm64\include\QtCore
Xcopy /E /I /Y /Q %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\include\QtCore\%ARM64_QT_VER%\QtCore %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\include\QtCore

set build_arch=ARM64

REM set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf"

REM type %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf

REM set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf"
REM type %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf
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

echo [DevicePaths] > %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo Prefix=C:/Qt/Qt-6.3.1 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo [Paths] >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo Prefix=../ >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo HostPrefix=../../msvc2019_64 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo HostData=../msvc2019_arm64 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo Sysroot= >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo SysrootifyPrefix=false >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo TargetSpec=win32-arm64-msvc >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo HostSpec=win32-msvc >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo Documentation=../../Docs/Qt-6.3.1 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo Examples=../../Examples/Qt-6.3.1 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf
echo [DevicePaths] > %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo Prefix=%qt_root_dir% >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo [Paths] >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo Prefix=../ >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo HostPrefix=../../msvc2019_64 >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo HostData=../msvc2019_arm64 >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo Sysroot= >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo SysrootifyPrefix=false >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo TargetSpec=win32-arm64-msvc >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo HostSpec=win32-msvc >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo Documentation=../../Docs/Qt-%ARM64_QT_VER% >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf
echo Examples=../../Examples/Qt-%ARM64_QT_VER% >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf

set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf"
set qt_params=-qtconf "%qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf"

REM set VSCMD_DEBUG=3
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
REM set VSCMD_DEBUG=3
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
) ELSE (
echo Unknown architecture!
call :print_usage
exit /b 2
)
@echo on



mkdir %~dp0\Build_UGlobalHotkey_%build_arch%
cd %~dp0\Build_UGlobalHotkey_%build_arch%
cd /d %~dp0\Build_UGlobalHotkey_%build_arch%

%qt_path%\bin\qmake.exe %~dp0\UGlobalHotkey\uglobalhotkey.qc.pro %qt_params%
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism%
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%
cd /d %~dp0\Build_qtsingleapp_%build_arch%

%qt_path%\bin\qmake.exe %~dp0\QtSingleApp\qtsingleapp\qtsingleapp\qtsingleapp.qc.pro %qt_params%
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism%
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%
cd /d %~dp0\Build_MiscHelpers_%build_arch%

%qt_path%\bin\qmake.exe %~dp0\MiscHelpers\MiscHelpers.qc.pro %qt_params%
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism%
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%
cd /d %~dp0\Build_QSbieAPI_%build_arch%

%qt_path%\bin\qmake.exe %~dp0\QSbieAPI\QSbieAPI.qc.pro %qt_params%
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism%
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%
cd /d %~dp0\Build_SandMan_%build_arch%

%qt_path%\bin\qmake.exe %~dp0\SandMan\SandMan.qc.pro %qt_params%
%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8
%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism%
IF %ERRORLEVEL% NEQ 0 goto :error
if NOT EXIST %~dp0\bin\%build_arch%\Release\SandMan.exe goto :error



cd %~dp0
cd /d %~dp0

rem dir .\bin
rem dir .\bin\%build_arch%
rem dir .\bin\%build_arch%\Release

goto :eof
exit /b 0

:print_usage
echo Usage: qmake_plus.cmd ^<architecture^> ^[Qt root directory^] ^[Threads to use (jom -j value)^]
echo Architecture can be Win32 / x64 / ARM64
echo Qt root directory defaults to ..\..\Qt
echo Threads to use defaults to 8
echo Example: qmake_plus.cmd x64 D:\Qt 12
exit /b 0

:error
echo Build failed
exit 1
echo Build failed! Make sure you installed the correct Qt version and components
cd /d %ORIGINAL_FOLDER%
exit /b 1

Loading