From bdbd24a4a383bd23d78348500516bab560e21f4f Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Thu, 25 Jul 2024 17:30:03 +0200 Subject: [PATCH] Allow setting the windows arch for the vcpkg installation script Make the Windows vcpkg provisioning script configurable, so scripts that use it may select the architecture using the 'arch' argument. Change-Id: Id6180866ed03a9a15ec9b907c9be5545a04ea879 Reviewed-by: Alexandru Croitor --- .../common/windows/install-vcpkg.ps1 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/coin/provisioning/common/windows/install-vcpkg.ps1 b/coin/provisioning/common/windows/install-vcpkg.ps1 index f5d1dad3..ee42557d 100644 --- a/coin/provisioning/common/windows/install-vcpkg.ps1 +++ b/coin/provisioning/common/windows/install-vcpkg.ps1 @@ -1,5 +1,7 @@ # Copyright (C) 2023 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +param([string]$arch="x64") + . "$PSScriptRoot\helpers.ps1" # This script will install vcpkg @@ -26,9 +28,19 @@ $n = $n.Split('=') $vcpkgExeReleaseTag = $n[1] $nonDottedReleaseTag = $vcpkgExeReleaseTag.replace('-', "") -$vcpkgExeOfficialUrl = "https://github.com/microsoft/vcpkg-tool/releases/download/$vcpkgExeReleaseTag/vcpkg.exe" -$vcpkgExeCacheUrl = "\\ci-files01-hki.ci.qt.io\provisioning\vcpkg\vcpkg-$nonDottedReleaseTag-windows-x64.exe" -$vcpkgExeSHA1 = "F74DCDE7F6F5082EF6DC31FED486FAD69BE8D442" +$suffix = "-$arch" +if($arch -eq "x64") { + $suffix = "" +} + +if($arch -eq "x64") { + $vcpkgExeSHA1 = "F74DCDE7F6F5082EF6DC31FED486FAD69BE8D442" +} elseif($arch -eq "arm64") { + $vcpkgExeSHA1 = "75049DC9A6FB813EFB7B48B2140DE067E73E977C" +} + +$vcpkgExeOfficialUrl = "https://github.com/microsoft/vcpkg-tool/releases/download/$vcpkgExeReleaseTag/vcpkg$suffix.exe" +$vcpkgExeCacheUrl = "\\ci-files01-hki.ci.qt.io\provisioning\vcpkg\vcpkg-$nonDottedReleaseTag-windows-$arch.exe" $vcpkgExe = "C:\Windows\Temp\vcpkg.exe" Download "$vcpkgExeOfficialUrl" "$vcpkgExeCacheUrl" "$vcpkgExe"