Fix Windows ANGLE preflight
This commit is contained in:
1 parent
9433155105
commit
3e9f6f90d2
3 files changed
+46
-3
No files matched your search
@@ -62,7 +62,7 @@ jobs:
|
|||||||
- rid: win-arm64
|
- rid: win-arm64
|
||||||
target_cpu: arm64
|
target_cpu: arm64
|
||||||
msvc_arch: amd64_arm64
|
msvc_arch: amd64_arm64
|
||||||
runs-on: windows-latest
|
runs-on: windows-2022
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -84,6 +84,15 @@ jobs:
|
|||||||
git config --global core.longpaths true
|
git config --global core.longpaths true
|
||||||
choco install ninja llvm -y
|
choco install ninja llvm -y
|
||||||
|
|
||||||
|
- name: Validate Windows ANGLE inputs
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
RID: ${{ matrix.rid }}
|
||||||
|
TARGET_CPU: ${{ matrix.target_cpu }}
|
||||||
|
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
|
||||||
|
GYP_MSVS_VERSION: 17.0
|
||||||
|
run: .\scripts\build-windows-static-graphics.ps1 angle-preflight
|
||||||
|
|
||||||
- name: Build Windows static graphics libraries
|
- name: Build Windows static graphics libraries
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ diff --git a/BUILD.gn b/BUILD.gn
|
|||||||
index 07e1268a57..25f7cba544 100644
|
index 07e1268a57..25f7cba544 100644
|
||||||
--- a/BUILD.gn
|
--- a/BUILD.gn
|
||||||
+++ b/BUILD.gn
|
+++ b/BUILD.gn
|
||||||
@@ -1472,7 +1472,18 @@ if (angle_has_frame_capture) {
|
@@ -1573,7 +1573,18 @@ if (angle_has_frame_capture) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
param(
|
param(
|
||||||
[ValidateSet("skia", "angle", "all")]
|
[ValidateSet("skia", "angle", "angle-preflight", "all")]
|
||||||
[string]$Target = "all"
|
[string]$Target = "all"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -186,11 +186,44 @@ function Apply-AnglePatches($Src) {
|
|||||||
$patch = Join-Path $AnglePatchDir "angle-chromium-$AngleBranch.patch"
|
$patch = Join-Path $AnglePatchDir "angle-chromium-$AngleBranch.patch"
|
||||||
if ((Test-Path $patch) -and -not (Select-String -Path (Join-Path $Src "BUILD.gn") -Pattern 'angle_static_library\("libANGLE_static"\)' -Quiet)) {
|
if ((Test-Path $patch) -and -not (Select-String -Path (Join-Path $Src "BUILD.gn") -Pattern 'angle_static_library\("libANGLE_static"\)' -Quiet)) {
|
||||||
$null = git -C $Src apply $patch
|
$null = git -C $Src apply $patch
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "Failed to apply ANGLE patch: $patch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Assert-AngleVisualStudioVersion {
|
||||||
|
if ($env:VisualStudioVersion -and -not ($env:VisualStudioVersion -in @("17.0", "16.0", "15.0"))) {
|
||||||
|
throw "ANGLE $AngleBranch requires Visual Studio 2022/2019/2017, but VisualStudioVersion is $env:VisualStudioVersion. Use windows-2022 or a VS 2022 developer prompt."
|
||||||
|
}
|
||||||
|
if ($env:GYP_MSVS_OVERRIDE_PATH -and ($env:GYP_MSVS_OVERRIDE_PATH -match '\\Microsoft Visual Studio\\18\\')) {
|
||||||
|
throw "ANGLE $AngleBranch requires Visual Studio 2022/2019/2017, but GYP_MSVS_OVERRIDE_PATH points to $env:GYP_MSVS_OVERRIDE_PATH. Use windows-2022 or a VS 2022 developer prompt."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Test-AnglePatch {
|
||||||
|
Require-Command git
|
||||||
|
Assert-AngleVisualStudioVersion
|
||||||
|
|
||||||
|
$src = Sync-Angle
|
||||||
|
$patch = Join-Path $AnglePatchDir "angle-chromium-$AngleBranch.patch"
|
||||||
|
if (-not (Test-Path $patch)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (Select-String -Path (Join-Path $src "BUILD.gn") -Pattern 'angle_static_library\("libANGLE_static"\)' -Quiet) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
$null = git -C $src apply --check $patch
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "ANGLE patch does not apply: $patch"
|
||||||
|
}
|
||||||
|
Write-Host "ANGLE preflight passed."
|
||||||
|
}
|
||||||
|
|
||||||
function Build-Angle {
|
function Build-Angle {
|
||||||
Ensure-Tools
|
Ensure-Tools
|
||||||
|
Assert-AngleVisualStudioVersion
|
||||||
Ensure-DepotTools
|
Ensure-DepotTools
|
||||||
$src = Sync-Angle
|
$src = Sync-Angle
|
||||||
New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null
|
New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null
|
||||||
@@ -229,6 +262,7 @@ New-Item -ItemType Directory -Path $WorkDir -Force | Out-Null
|
|||||||
New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null
|
New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null
|
||||||
switch ($Target) {
|
switch ($Target) {
|
||||||
"skia" { Build-Skia }
|
"skia" { Build-Skia }
|
||||||
|
"angle-preflight" { Test-AnglePatch }
|
||||||
"angle" { Build-Angle }
|
"angle" { Build-Angle }
|
||||||
"all" { Build-Skia; Build-Angle }
|
"all" { Build-Skia; Build-Angle }
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user