Skip to content

Commit

Permalink
Derive target architecture based on Qt path
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Nov 22, 2022
1 parent 31869a7 commit 89cbbfc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ before_build:

build_script:
- 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: 'scripts\build-arch.bat Release x86'
- cmd: 'scripts\build-arch.bat Release'
- cmd: 'scripts\generate-bundle.bat Release'
- sh: '[ "$BUILD_TARGET" != linux ] || source /opt/qt515/bin/qt515-env.sh'
- sh: '[ "$BUILD_TARGET" != linux ] || PATH=$PATH:$HOME/bin scripts/build-appimage.sh'
Expand Down
24 changes: 16 additions & 8 deletions scripts/build-arch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ setlocal enableDelayedExpansion
rem Run from Qt command prompt with working directory set to root of repo

set BUILD_CONFIG=%1
set ARCH=%2

rem Convert to lower case for windeployqt
if /I "%BUILD_CONFIG%"=="debug" (
Expand All @@ -28,22 +27,31 @@ if /I "%BUILD_CONFIG%"=="debug" (
)
) else (
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
)
)
)

if /I "%ARCH%" NEQ "x86" (
if /I "%ARCH%" NEQ "x64" (
if /I "%ARCH%" NEQ "ARM64" (
echo Invalid build architecture - expected 'x86', 'x64', or 'ARM64'
echo Usage: scripts\build-arch.bat ^(release^|debug^) ^(x86^|x64^|ARM64^)
exit /b 1
rem Find Qt path to determine our architecture
for /F %%i in ('where qmake') do set QT_PATH=%%i
if not x%QT_PATH:_arm64=%==x%QT_PATH% (
set ARCH=ARM64
) else (
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 BUILD_ROOT=%cd%\build
Expand Down

0 comments on commit 89cbbfc

Please sign in to comment.