Derive target architecture based on Qt path

This commit is contained in:
Cameron Gutman 2022-11-21 21:30:24 -06:00
parent 31869a7da2
commit 89cbbfc291
2 changed files with 18 additions and 10 deletions

View File

@ -39,9 +39,9 @@ before_build:
build_script: build_script:
- cmd: 'set PATH=%OLDPATH%;%QTDIR%\msvc2019_64\bin;%ProgramFiles(x86)%\WiX Toolset v3.11\bin' - cmd: 'set PATH=%OLDPATH%;%QTDIR%\msvc2019_64\bin;%ProgramFiles(x86)%\WiX Toolset v3.11\bin'
- cmd: 'scripts\build-arch.bat Release x64' - cmd: 'scripts\build-arch.bat Release'
- cmd: 'set PATH=%OLDPATH%;%QTDIR%\msvc2019\bin;%ProgramFiles(x86)%\WiX Toolset v3.11\bin' - cmd: 'set PATH=%OLDPATH%;%QTDIR%\msvc2019\bin;%ProgramFiles(x86)%\WiX Toolset v3.11\bin'
- cmd: 'scripts\build-arch.bat Release x86' - cmd: 'scripts\build-arch.bat Release'
- cmd: 'scripts\generate-bundle.bat Release' - cmd: 'scripts\generate-bundle.bat Release'
- sh: '[ "$BUILD_TARGET" != linux ] || source /opt/qt515/bin/qt515-env.sh' - sh: '[ "$BUILD_TARGET" != linux ] || source /opt/qt515/bin/qt515-env.sh'
- sh: '[ "$BUILD_TARGET" != linux ] || PATH=$PATH:$HOME/bin scripts/build-appimage.sh' - sh: '[ "$BUILD_TARGET" != linux ] || PATH=$PATH:$HOME/bin scripts/build-appimage.sh'

View File

@ -4,7 +4,6 @@ setlocal enableDelayedExpansion
rem Run from Qt command prompt with working directory set to root of repo rem Run from Qt command prompt with working directory set to root of repo
set BUILD_CONFIG=%1 set BUILD_CONFIG=%1
set ARCH=%2
rem Convert to lower case for windeployqt rem Convert to lower case for windeployqt
if /I "%BUILD_CONFIG%"=="debug" ( if /I "%BUILD_CONFIG%"=="debug" (
@ -28,22 +27,31 @@ if /I "%BUILD_CONFIG%"=="debug" (
) )
) else ( ) else (
echo Invalid build configuration - expected 'debug' or 'release' echo Invalid build configuration - expected 'debug' or 'release'
echo Usage: scripts\build-arch.bat ^(release^|debug^) ^(x86^|x64^|ARM64^) echo Usage: scripts\build-arch.bat ^(release^|debug^)
exit /b 1 exit /b 1
) )
) )
) )
if /I "%ARCH%" NEQ "x86" ( rem Find Qt path to determine our architecture
if /I "%ARCH%" NEQ "x64" ( for /F %%i in ('where qmake') do set QT_PATH=%%i
if /I "%ARCH%" NEQ "ARM64" ( if not x%QT_PATH:_arm64=%==x%QT_PATH% (
echo Invalid build architecture - expected 'x86', 'x64', or 'ARM64' set ARCH=ARM64
echo Usage: scripts\build-arch.bat ^(release^|debug^) ^(x86^|x64^|ARM64^) ) else (
exit /b 1 if not x%QT_PATH:_64=%==x%QT_PATH% (
set ARCH=x64
) else (
if not x%QT_PATH:msvc=%==x%QT_PATH% (
set ARCH=x86
) else (
echo Unable to determine Qt architecture
goto Error
) )
) )
) )
echo Detected target architecture: %ARCH%
set SIGNTOOL_PARAMS=sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /sha1 b28642b756ebec4884d1063dfa4de803a6dcecdc /v set SIGNTOOL_PARAMS=sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /sha1 b28642b756ebec4884d1063dfa4de803a6dcecdc /v
set BUILD_ROOT=%cd%\build set BUILD_ROOT=%cd%\build