Make ANGLE BUILD patch deterministic
This commit is contained in:
1 parent
b04d804d84
commit
ddb312a3cd
2 files changed
+26
-32
No files matched your search
@@ -1,23 +1,3 @@
|
|||||||
diff --git a/BUILD.gn b/BUILD.gn
|
|
||||||
index 07e1268a57..25f7cba544 100644
|
|
||||||
--- a/BUILD.gn
|
|
||||||
+++ b/BUILD.gn
|
|
||||||
@@ -1576,4 +1576,15 @@ angle_static_library("libGLESv2_static") {
|
|
||||||
+angle_static_library("libANGLE_static") {
|
|
||||||
+ complete_static_lib = true
|
|
||||||
+ public_deps = [ ":libANGLE" ]
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+angle_static_library("libANGLE_with_capture_static") {
|
|
||||||
+ complete_static_lib = true
|
|
||||||
+ public_deps = [ ":libANGLE_with_capture" ]
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
angle_static_library("libGLESv2_static") {
|
|
||||||
+ complete_static_lib = true
|
|
||||||
sources = libglesv2_sources
|
|
||||||
if (angle_enable_cl) {
|
|
||||||
sources += libglesv2_cl_sources
|
|
||||||
diff --git a/DEPS b/DEPS
|
diff --git a/DEPS b/DEPS
|
||||||
index 9085ba513e..565840a832 100644
|
index 9085ba513e..565840a832 100644
|
||||||
--- a/DEPS
|
--- a/DEPS
|
||||||
|
|||||||
@@ -183,8 +183,30 @@ function Sync-Angle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Apply-AnglePatches($Src) {
|
function Apply-AnglePatches($Src) {
|
||||||
|
$buildFile = Join-Path $Src "BUILD.gn"
|
||||||
|
$buildText = Get-Content -Path $buildFile -Raw
|
||||||
|
if (-not $buildText.Contains('angle_static_library("libANGLE_static")')) {
|
||||||
|
$libAngleTargets = @'
|
||||||
|
angle_static_library("libANGLE_static") {
|
||||||
|
complete_static_lib = true
|
||||||
|
public_deps = [ ":libANGLE" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
angle_static_library("libANGLE_with_capture_static") {
|
||||||
|
complete_static_lib = true
|
||||||
|
public_deps = [ ":libANGLE_with_capture" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
angle_static_library("libGLESv2_static") {
|
||||||
|
'@
|
||||||
|
$buildText = [regex]::Replace($buildText, '(?m)^angle_static_library\("libGLESv2_static"\) \{', $libAngleTargets)
|
||||||
|
$buildText = [regex]::Replace($buildText, '(?m)^angle_static_library\("libGLESv2_static"\) \{\r?\n sources = libglesv2_sources', "angle_static_library(`"libGLESv2_static`") {`n complete_static_lib = true`n sources = libglesv2_sources")
|
||||||
|
Set-Content -Path $buildFile -Value $buildText -NoNewline -Encoding UTF8
|
||||||
|
}
|
||||||
|
|
||||||
$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)) {
|
$depsFile = Join-Path $Src "DEPS"
|
||||||
|
if ((Test-Path $patch) -and (Select-String -Path $depsFile -Pattern "'third_party/catapult'" -Quiet)) {
|
||||||
$null = git -C $Src apply $patch
|
$null = git -C $Src apply $patch
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
throw "Failed to apply ANGLE patch: $patch"
|
throw "Failed to apply ANGLE patch: $patch"
|
||||||
@@ -206,17 +228,9 @@ function Test-AnglePatch {
|
|||||||
Assert-AngleVisualStudioVersion
|
Assert-AngleVisualStudioVersion
|
||||||
|
|
||||||
$src = Sync-Angle
|
$src = Sync-Angle
|
||||||
$patch = Join-Path $AnglePatchDir "angle-chromium-$AngleBranch.patch"
|
Apply-AnglePatches $src
|
||||||
if (-not (Test-Path $patch)) {
|
if (-not (Select-String -Path (Join-Path $src "BUILD.gn") -Pattern 'angle_static_library\("libANGLE_static"\)' -Quiet)) {
|
||||||
return
|
throw "ANGLE BUILD.gn preflight failed."
|
||||||
}
|
|
||||||
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."
|
Write-Host "ANGLE preflight passed."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user