diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index daa5b869433c47..818fbf2a8244aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -296,7 +296,7 @@ jobs: if: always() strategy: matrix: - arch: [x64, x86] + arch: [x64, x86, ARM64] env: CMAKE_GENERATOR: 'Visual Studio 17 2022' CMAKE_SYSTEM_VERSION: '10.0.18363.657' @@ -324,6 +324,7 @@ jobs: - name: 'Restore VLC dependency from cache' id: vlc-cache + if: matrix.arch != 'ARM64' uses: actions/cache@v3 env: CACHE_NAME: 'vlc-cache' @@ -333,6 +334,7 @@ jobs: - name: 'Restore Chromium Embedded Framework from cache' id: cef-cache + if: matrix.arch != 'ARM64' uses: actions/cache@v3 env: CACHE_NAME: 'cef-cache' diff --git a/CI/windows/01_install_dependencies.ps1 b/CI/windows/01_install_dependencies.ps1 index 3691564bc242f1..b9eb278b7d0008 100644 --- a/CI/windows/01_install_dependencies.ps1 +++ b/CI/windows/01_install_dependencies.ps1 @@ -2,7 +2,7 @@ Param( [Switch]$Help = $(if (Test-Path variable:Help) { $Help }), [Switch]$Quiet = $(if (Test-Path variable:Quiet) { $Quiet }), [Switch]$Verbose = $(if (Test-Path variable:Verbose) { $Verbose }), - [ValidateSet('x86', 'x64')] + [ValidateSet('x86', 'x64', 'ARM64')] [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { ('x86', 'x64')[[System.Environment]::Is64BitOperatingSystem] }) ) @@ -26,7 +26,7 @@ Function Install-obs-deps { Write-Status "Setup for pre-built Windows OBS dependencies v${Version}" Ensure-Directory $DepsBuildDir - $ArchSuffix = $BuildArch + $ArchSuffix = $BuildArch.ToLower() if (!(Test-Path "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}")) { @@ -52,17 +52,26 @@ function Install-qt-deps { Write-Status "Setup for pre-built dependency Qt v${Version}" Ensure-Directory $DepsBuildDir - $ArchSuffix = $BuildArch + $ArchSuffix = $BuildArch.ToLower() if (!(Test-Path "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}/mkspecs")) { + if (${BuildArch} -eq "arm64") { + Write-Step "Download x64 qt..." + $ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' }) + Invoke-WebRequest -Uri "https://github.com/obsproject/obs-deps/releases/download/${Version}/windows-deps-qt6-${Version}-${ArchSuffix}.zip" -UseBasicParsing -OutFile "windows-deps-qt6-${Version}-${ArchSuffix}.zip" + $ProgressPreference = "Continue" + + Write-Step "Unpack x64 qt..." + Expand-Archive -Path "windows-deps-qt6-${Version}-${ArchSuffix}.zip" -DestinationPath "${DepsBuildDir}/qt_host" -Force + } + Write-Step "Download..." $ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' }) Invoke-WebRequest -Uri "https://github.com/obsproject/obs-deps/releases/download/${Version}/windows-deps-qt6-${Version}-${ArchSuffix}.zip" -UseBasicParsing -OutFile "windows-deps-qt6-${Version}-${ArchSuffix}.zip" $ProgressPreference = "Continue" Write-Step "Unpack..." - Expand-Archive -Path "windows-deps-qt6-${Version}-${ArchSuffix}.zip" -DestinationPath "${DepsBuildDir}/windows-deps-${Version}-${ArchSuffix}" -Force } else { Write-Step "Found existing pre-built Qt..." @@ -75,6 +84,10 @@ function Install-vlc { [String]$Version ) + if (${BuildArch} -eq "arm64") { + Write-Status "Skip VLC for Winodws ARM64" + } + Write-Status "Setup for dependency VLC v${Version}" Ensure-Directory $DepsBuildDir @@ -98,6 +111,11 @@ function Install-cef { [Parameter(Mandatory=$true)] [String]$Version ) + + if (${BuildArch} -eq "arm64") { + Write-Status "Skip VLC for Winodws ARM64" + } + Write-Status "Setup for dependency CEF v${Version} - ${BuildArch}" Ensure-Directory $DepsBuildDir diff --git a/CI/windows/02_build_obs.ps1 b/CI/windows/02_build_obs.ps1 index b075e07ec98183..af37390634598c 100644 --- a/CI/windows/02_build_obs.ps1 +++ b/CI/windows/02_build_obs.ps1 @@ -3,7 +3,7 @@ Param( [Switch]$Quiet = $(if (Test-Path variable:Quiet) { $Quiet }), [Switch]$Verbose = $(if (Test-Path variable:Verbose) { $Verbose }), [String]$BuildDirectory = $(if (Test-Path variable:BuildDirectory) { "${BuildDirectory}" } else { "build" }), - [ValidateSet('x86', 'x64')] + [ValidateSet('x86', 'x64', 'ARM64')] [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { ('x86', 'x64')[[System.Environment]::Is64BitOperatingSystem] }), [ValidateSet("Release", "RelWithDebInfo", "MinSizeRel", "Debug")] [String]$BuildConfiguration = $(if (Test-Path variable:BuildConfiguration) { "${BuildConfiguration}" } else { "RelWithDebInfo" }) @@ -61,7 +61,11 @@ function Configure-OBS { $CmakePrefixPath = Resolve-Path -Path "${CheckoutDir}/../obs-build-dependencies/windows-deps-${WindowsDepsVersion}-${BuildArch}" $CefDirectory = Resolve-Path -Path "${CheckoutDir}/../obs-build-dependencies/cef_binary_${WindowsCefVersion}_windows_${BuildArch}" $BuildDirectoryActual = "${BuildDirectory}$(if (${BuildArch} -eq "x64") { "64" } else { "32" })" - $GeneratorPlatform = "$(if (${BuildArch} -eq "x64") { "x64" } else { "Win32" })" + + $GeneratorPlatform = "$(if (${BuildArch} -eq "x86") { "Win32" } else { ${BuildArch} })" + if (${BuildArch} -eq "arm64") { + $Qt_Host_Path = Resolve-Path -Path "${CmakePrefixPath}/../qt_host" + } if ( $PSVersionTable.PSVersion -ge '7.3.0' ) { $CmakeCommand = @( @@ -69,6 +73,8 @@ function Configure-OBS { "-DCMAKE_GENERATOR_PLATFORM=${GeneratorPlatform}", "-DCMAKE_SYSTEM_VERSION=${CmakeSystemVersion}", "-DCMAKE_PREFIX_PATH:PATH=${CmakePrefixPath}", + "-DCMAKE_TOOLCHAIN_FILE=${CmakePrefixPath}/lib/cmake/Qt6/qt.toolchain.cmake", + "$(if (${BuildArch} -eq "arm64") { "QT_HOST_PATH=${Qt_Host_Path}" })", "-DCEF_ROOT_DIR:PATH=${CefDirectory}", "-DENABLE_BROWSER=ON", "-DVLC_PATH:PATH=${CheckoutDir}/../obs-build-dependencies/vlc-${WindowsVlcVersion}", @@ -95,6 +101,8 @@ function Configure-OBS { "-DCMAKE_GENERATOR_PLATFORM=`"${GeneratorPlatform}`"", "-DCMAKE_SYSTEM_VERSION=`"${CmakeSystemVersion}`"", "-DCMAKE_PREFIX_PATH:PATH=`"${CmakePrefixPath}`"", + "-DCMAKE_TOOLCHAIN_FILE=`"${CmakePrefixPath}\lib\cmake\Qt6\qt.toolchain.cmake`"", + "$(if (${BuildArch} -eq "arm64") { "QT_HOST_PATH=${Qt_Host_Path}" })", "-DCEF_ROOT_DIR:PATH=`"${CefDirectory}`"", "-DENABLE_BROWSER=ON", "-DVLC_PATH:PATH=`"${CheckoutDir}/../obs-build-dependencies/vlc-${WindowsVlcVersion}`"", diff --git a/CI/windows/03_package_obs.ps1 b/CI/windows/03_package_obs.ps1 index 6801aef88d86cb..5d7c8a05c34d14 100644 --- a/CI/windows/03_package_obs.ps1 +++ b/CI/windows/03_package_obs.ps1 @@ -5,7 +5,7 @@ Param( [Switch]$BuildInstaller = $(if ($BuildInstaller.isPresent) { $BuildInstaller }), [Switch]$CombinedArchs = $(if ($CombinedArchs.isPresent) { $CombinedArchs }), [String]$BuildDirectory = $(if (Test-Path variable:BuildDirectory) { "${BuildDirectory}" } else { "build" }), - [ValidateSet('x86', 'x64')] + [ValidateSet('x86', 'x64', 'ARM64')] [String]$BuildArch = $(if (Test-Path variable:BuildArch) { "${BuildArch}" } else { ('x86', 'x64')[[System.Environment]::Is64BitOperatingSystem] }), [ValidateSet("Release", "RelWithDebInfo", "MinSizeRel", "Debug")] [String]$BuildConfiguration = $(if (Test-Path variable:BuildConfiguration) { "${BuildConfiguration}" } else { "RelWithDebInfo" }) @@ -82,6 +82,22 @@ function Package-OBS { Compress-Archive -Force @CompressVars $ProgressPreference = 'Continue' + } elseif ($BuildArch -eq "ARM64") { + Write-Step "Install 64-bit OBS..." + Invoke-Expression "cmake --build `"${BuildDirectory}64`" --config ${BuildConfiguration} -t install" + + $CompressVars = @{ + Path = "${CheckoutDir}/build64/install/bin", "${CheckoutDir}/build64/install/data", "${CheckoutDir}/build64/install/obs-plugins" + CompressionLevel = "Optimal" + DestinationPath = "${FileName}-Win-ARM64.zip" + } + + Write-Step "Creating zip archive..." + + $ProgressPreference = $(if ($Quiet.isPresent) { 'SilentlyContinue' } else { 'Continue' }) + Compress-Archive -Force @CompressVars + $ProgressPreference = 'Continue' + } elseif ($BuildArch -eq "x86") { Write-Step "Install 32-bit OBS..." Invoke-Expression "cmake --build `"${BuildDirectory}32`" --config ${BuildConfiguration} -t install"