Fix Windows ANGLE preflight

This commit is contained in:
geruipu committed 2026-06-20 23:36:32 +08:00
1 parent 9433155105
commit 3e9f6f90d2
3 files changed
+47 -4

No files matched your search

+10 -1
View File
@@ -62,7 +62,7 @@ jobs:
- rid: win-arm64
target_cpu: arm64
msvc_arch: amd64_arm64
runs-on: windows-latest
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
@@ -84,6 +84,15 @@ jobs:
git config --global core.longpaths true
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
shell: pwsh
env:
+2 -2
View File
@@ -2,10 +2,10 @@ diff --git a/BUILD.gn b/BUILD.gn
index 07e1268a57..25f7cba544 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1472,7 +1472,18 @@ if (angle_has_frame_capture) {
@@ -1573,7 +1573,18 @@ if (angle_has_frame_capture) {
}
}
+angle_static_library("libANGLE_static") {
+ complete_static_lib = true
+ public_deps = [ ":libANGLE" ]
+35 -1
View File
@@ -1,5 +1,5 @@
param(
[ValidateSet("skia", "angle", "all")]
[ValidateSet("skia", "angle", "angle-preflight", "all")]
[string]$Target = "all"
)
@@ -186,11 +186,44 @@ function Apply-AnglePatches($Src) {
$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)) {
$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 {
Ensure-Tools
Assert-AngleVisualStudioVersion
Ensure-DepotTools
$src = Sync-Angle
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
switch ($Target) {
"skia" { Build-Skia }
"angle-preflight" { Test-AnglePatch }
"angle" { Build-Angle }
"all" { Build-Skia; Build-Angle }
}