Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/skia/scripts/build-skia.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { exit } from "process";
import path from "path";

import type { Platform, PlatformName } from "./skia-configuration";
import {
applyGraphiteSkiaPatches,
commonArgs,
configurations,
copyHeaders,
Expand Down Expand Up @@ -279,6 +281,22 @@ const buildXCFrameworks = () => {
process.chdir(SkiaSrc);
$("PATH=../depot_tools/:$PATH python3 tools/git-sync-deps");
console.log("gclient sync done");
if (GRAPHITE) {
console.log("Applying Graphite patches...");
$(`git reset --hard HEAD`);

// Apply arm64e simulator patch
const arm64ePatchFile = path.join(__dirname, "dawn-arm64e-simulator.patch");
$(`cd ${SkiaSrc} && git apply ${arm64ePatchFile}`);

// Fix Dawn ShaderModuleMTL.mm uint32 typo if it exists
const shaderModuleFile = `${SkiaSrc}/third_party/externals/dawn/src/dawn/native/metal/ShaderModuleMTL.mm`;
$(
`sed -i '' 's/uint32(bindingInfo\\.binding)/uint32_t(bindingInfo.binding)/g' ${shaderModuleFile}`
);

console.log("Patches applied successfully");
}
$(`rm -rf ${PackageRoot}/libs`);

// Build specified platforms and targets
Expand Down
32 changes: 32 additions & 0 deletions packages/skia/scripts/dawn-arm64e-simulator.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From e34f6eaae468d0499b544815f67a73c6f75e9d56 Mon Sep 17 00:00:00 2001
From: William Candillon <[email protected]>
Date: Sat, 18 Oct 2025 18:45:06 +0200
Subject: [PATCH] Remove unavailable platform on simulator

---
gn/skia/BUILD.gn | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gn/skia/BUILD.gn b/gn/skia/BUILD.gn
index 8e42db771b..30048a1d43 100644
--- a/gn/skia/BUILD.gn
+++ b/gn/skia/BUILD.gn
@@ -199,9 +199,13 @@ config("default") {
_arch_flags = [
"-arch",
"arm64",
- "-arch",
- "arm64e",
]
+ if (!ios_use_simulator) {
+ _arch_flags += [
+ "-arch",
+ "arm64e",
+ ]
+ }
} else if (current_cpu == "x86") {
_arch_flags = [
"-arch",
--
2.42.0

Loading