Просмотр исходного кода

Merge topic 'ci-rel-win-arm64'

41ea4d4de8 ci: Rebuild Qt 6.3.0 windows-arm64 dependency with LLVM/Clang
e0d9ee0cc4 Utilities/Release: Simplify script to build Qt 6.3.0 Windows binaries

Acked-by: Kitware Robot <[email protected]>
Merge-request: !7380
Brad King 3 лет назад
Родитель
Сommit
32604113b6

+ 3 - 3
.gitlab/ci/download_qt_hashes.cmake

@@ -16,6 +16,6 @@ set("qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz_hash" 7b9463a01c8beeee5bf8d01c70d
 set("qt-5.12.1-win-i386-msvc_v142-1.zip_hash" aa78711fdaa5d9b146bf7ddcf15983f9fbb3f995462f2d043f8cca74b40ddd11)
 set("qt-5.12.1-win-x86_64-msvc_v142-1.zip_hash" c2fc068b9dac40bb420e28e1ee15ce4f2ccfc866d767f3b99b6bb435b7c4f44b)
 
-set("qt-6.3.0-win-arm64-msvc_v143-1.zip_hash" 0950db703b0d305ff2855c69d8553e10036ebe5c65f95c4a850cf1f703410798)
-set("qt-6.3.0-win-i386-msvc_v143-1.zip_hash" 52d68ff3b8a045222b59ebe12878b8597e97019c2ae930e846ec816ce6df18db)
-set("qt-6.3.0-win-x86_64-msvc_v143-1.zip_hash" 3764a3076cf2331ec28bd88d6bddcab1578b1bb1329157bfe33ea02c2c63c6e1)
+set("qt-6.3.0-win-arm64-msvc_v143-1.zip_hash" f794c035fd4ff9f04468e1787a60d93d7496119c0060c3173a76d24a6b551b14)
+set("qt-6.3.0-win-i386-msvc_v143-1.zip_hash" 972bc707f78d11b44f360643ca4d0c898e761f7add43b96117d958c70d84a443)
+set("qt-6.3.0-win-x86_64-msvc_v143-1.zip_hash" 4fb0aaebe184f40392f1bb246469dca591bfdfb8f915e19f921476222473ac90)

+ 0 - 135
Utilities/Release/win/qt-6.3.0-win-msvc.ps1

@@ -1,135 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-# Run this script on a Windows host to generate Qt binaries.
-# Set the PATH environment variable to contain the locations of cmake and git.
-
-param (
-  [string]$cmake = 'cmake',
-  [string]$git = 'git',
-  [string]$ninja = 'ninja',
-  [switch]$trace
-)
-
-if ($trace -eq $true) {
-  Set-PSDebug -Trace 1
-}
-
-$ErrorActionPreference = 'Stop'
-$ProgressPreference = 'SilentlyContinue'
-
-if ($env:VSCMD_ARG_TGT_ARCH -eq "x64") {
-  $arch = "x86_64";
-} elseif ($env:VSCMD_ARG_TGT_ARCH -eq "x86") {
-  $arch = "i386";
-} elseif ($env:VSCMD_ARG_TGT_ARCH -eq "arm64") {
-  $arch = "arm64";
-} else {
-  Write-Host "VSCMD_ARG_TGT_ARCH env var not recognized.  Run this from a Visual Studio Command Prompt."
-  exit 1
-}
-
-if ($env:VCToolsVersion -match '^(?<version>[0-9][0-9]\.[0-9])') {
-  $toolset = "msvc_v" + $Matches.version -replace '\.', ''
-} else {
-  Write-Host "VCToolsVersion env var not set.  Run this from a Visual Studio Command Prompt."
-}
-
-$srcname = "qt-everywhere-src-6.3.0"
-$pkgname = "qt-6.3.0-win-$arch-$toolset-1"
-$pkgname_host = "qt-6.3.0-win-x86_64-$toolset-1"
-$topdir = $pwd.Path
-$srcdir = Join-Path $topdir $srcname
-$blddir = Join-Path $topdir "$pkgname-build"
-$prefix = Join-Path $topdir $pkgname
-$prefix_host = Join-Path $topdir "$pkgname_host"
-
-# Qt Source
-if ( -not (Test-Path -Path $srcdir)) {
-  Invoke-WebRequest -Uri "https://download.qt.io/official_releases/qt/6.3/6.3.0/single/qt-everywhere-src-6.3.0.tar.xz" -OutFile qt.tar.xz
-  if ($(Get-FileHash "qt.tar.xz").Hash -ne 'cd2789cade3e865690f3c18df58ffbff8af74cc5f01faae50634c12eb52dd85b') {
-      exit 1
-  }
-  & $cmake -E tar xvf qt.tar.xz
-  Remove-Item qt.tar.xz
-}
-
-# Build Qt
-if ( -not (Test-Path -Path $blddir)) {
-  New-Item -ItemType Directory -Path $blddir
-  Set-Location -Path "$blddir"
-  if ($arch -eq "arm64") {
-    $qt_platform = "win32-arm64-msvc"
-    $qt_host_path = "-qt-host-path", "$prefix_host"
-  } else {
-    $qt_platform = "win32-msvc"
-    $qt_host_path = $null
-  }
-  & ..\$srcname\configure.bat `
-    -prefix $prefix `
-    -static `
-    -static-runtime `
-    -release `
-    -opensource -confirm-license `
-    -platform $qt_platform `
-    $qt_host_path `
-    -gui `
-    -widgets `
-    -qt-doubleconversion `
-    -qt-freetype `
-    -qt-harfbuzz `
-    -qt-pcre `
-    -qt-zlib `
-    -qt-libpng `
-    -qt-libjpeg `
-    -no-gif `
-    -no-tiff `
-    -no-webp `
-    -no-icu `
-    -no-pch `
-    -no-opengl `
-    -no-dbus `
-    -no-accessibility `
-    -no-feature-androiddeployqt `
-    -no-feature-assistant `
-    -no-feature-designer `
-    -no-feature-linguist `
-    -no-feature-pixeltool `
-    -no-feature-printsupport `
-    -no-feature-qtattributionsscanner `
-    -no-feature-qtdiag `
-    -no-feature-qtplugininfo `
-    -no-feature-sql `
-    -no-feature-windeployqt `
-    -skip qtconnectivity `
-    -skip qtdeclarative `
-    -skip qtdoc `
-    -skip qtlottie `
-    -skip qtmqtt `
-    -skip qtmultimedia `
-    -skip qtopcua `
-    -skip qtquick3d `
-    -skip qtquicktimeline `
-    -skip qtscxml `
-    -skip qtsensors `
-    -skip qtserialport `
-    -skip qtsvg `
-    -skip qtvirtualkeyboard `
-    -skip qtwayland `
-    -skip qtwebchannel `
-    -skip qtwebengine `
-    -skip qtwebsockets `
-    -skip qtwebview `
-    -nomake examples `
-    -nomake tests
-  & $ninja
-}
-
-# Install Qt
-if ( -not (Test-Path -Path $prefix)) {
-  & $ninja install
-}
-
-# Package Qt
-Set-Location -Path $topdir
-& $cmake -E tar cf "$pkgname.zip" "--format=zip" "$pkgname"

+ 121 - 0
Utilities/Release/win/qtbase-6.3.0-win-msvc.cmake

@@ -0,0 +1,121 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Run this script in a Visual Studio Command Prompt to generate Qt binaries.
+
+cmake_minimum_required(VERSION 3.23)
+
+if ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "x64")
+  set(arch "x86_64")
+elseif ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "x86")
+  set(arch "i386")
+elseif ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "arm64")
+  set(arch "arm64")
+else()
+  message("VSCMD_ARG_TGT_ARCH env var not recognized.  Run this from a Visual Studio Command Prompt.")
+  return()
+endif()
+
+if ("$ENV{VCToolsVersion}" MATCHES [[^([0-9][0-9])\.([0-9])]])
+  set(toolset "msvc_v${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
+else()
+  message( "VCToolsVersion='$ENV{VCToolsVersion}' env var not recognized.  Run this from a Visual Studio Command Prompt.")
+  return()
+endif()
+
+set(srcname "qtbase-everywhere-src-6.3.0")
+set(pkgname "qt-6.3.0-win-${arch}-${toolset}-1")
+set(pkgname_host "qt-6.3.0-win-x86_64-${toolset}-1")
+set(topdir "${CMAKE_CURRENT_BINARY_DIR}")
+set(srcdir "${topdir}/${srcname}")
+set(blddir "${topdir}/${pkgname}-build")
+set(prefix "${topdir}/${pkgname}")
+set(prefix_host "${topdir}/${pkgname_host}")
+
+# Qt Source
+if (NOT EXISTS "${srcdir}")
+  file(DOWNLOAD "https://download.qt.io/official_releases/qt/6.3/6.3.0/submodules/qtbase-everywhere-src-6.3.0.tar.xz" qt.tar.xz
+       EXPECTED_HASH SHA256=b865aae43357f792b3b0a162899d9bf6a1393a55c4e5e4ede5316b157b1a0f99)
+  file(ARCHIVE_EXTRACT INPUT qt.tar.xz)
+  file(REMOVE qt.tar.xz)
+endif()
+
+# Download and use LLVM's clang-cl to compiler for arm64
+if (arch STREQUAL "arm64" AND CMAKE_ARGV3 STREQUAL "clang-cl")
+  set(ENV{PATH} "c:/Program Files/LLVM/bin;$ENV{PATH}")
+  set(ENV{CC} "clang-cl --target=arm64-pc-windows-msvc")
+  set(ENV{CXX} "clang-cl --target=arm64-pc-windows-msvc")
+endif()
+
+# Build Qt
+if (NOT EXISTS "${blddir}")
+  file(MAKE_DIRECTORY "${blddir}")
+  if ("${arch}" STREQUAL "arm64")
+    set(qt_platform "win32-arm64-msvc")
+    set(qt_host_path -qt-host-path "${prefix_host}")
+  else()
+    set(qt_platform "win32-msvc")
+    unset(qt_host_path)
+  endif()
+
+  execute_process(
+    RESULT_VARIABLE result
+    WORKING_DIRECTORY "${blddir}"
+    COMMAND
+      ${srcdir}/configure.bat
+      -prefix ${prefix}
+      -static
+      -static-runtime
+      -release
+      -opensource -confirm-license
+      -platform ${qt_platform}
+      ${qt_host_path}
+      -gui
+      -widgets
+      -qt-doubleconversion
+      -qt-freetype
+      -qt-harfbuzz
+      -qt-pcre
+      -qt-zlib
+      -qt-libpng
+      -qt-libjpeg
+      -no-gif
+      -no-icu
+      -no-pch
+      -no-opengl
+      -no-dbus
+      -no-accessibility
+      -no-feature-androiddeployqt
+      -no-feature-printsupport
+      -no-feature-sql
+      -nomake examples
+      -nomake tests
+  )
+  if(NOT result EQUAL 0)
+    message(FATAL_ERROR "configure.bat failed: ${result}")
+  endif()
+
+  execute_process(
+    RESULT_VARIABLE result
+    WORKING_DIRECTORY "${blddir}"
+    COMMAND ninja
+  )
+  if(NOT result EQUAL 0)
+    message(FATAL_ERROR "ninja failed: ${result}")
+  endif()
+endif()
+
+# Install Qt
+if (NOT EXISTS "${prefix}")
+  execute_process(
+    RESULT_VARIABLE result
+    WORKING_DIRECTORY "${blddir}"
+    COMMAND ninja install
+  )
+  if(NOT result EQUAL 0)
+    message(FATAL_ERROR "ninja install failed: ${result}")
+  endif()
+endif()
+
+# Package Qt
+file(ARCHIVE_CREATE OUTPUT "${pkgname}.zip" PATHS "${pkgname}" FORMAT "zip")