Skip to content

Migrate Apple native builds from Xcode projects to GN#4164

Open
mattleibow wants to merge 3 commits into
mainfrom
mattleibow/apple-gn-off-main
Open

Migrate Apple native builds from Xcode projects to GN#4164
mattleibow wants to merge 3 commits into
mainfrom
mattleibow/apple-gn-off-main

Conversation

@mattleibow

@mattleibow mattleibow commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #4168

Summary

Migrate the Apple native builds (libSkiaSharp + libHarfBuzzSharp for macOS, iOS, tvOS and Mac Catalyst) off the hand-maintained Xcode projects and onto the existing GN skiasharp_build targets — the same path Linux, Windows, WASM and Android already use.

Lands cleanly off main (independent of the in-flight C-API-move work) to give a simpler baseline and avoid conflicts. Requires the submodule half: mono/skia#256.

Changes

  • Delete all 6 *.xcodeproj bundles (ios/tvos/macos × both libs) and scripts/infra/native/apple/xcode.cake.
  • Rewrite native/{ios,tvos,macos}/build.cake to drive GN/ninja only.
  • Add scripts/infra/native/apple/apple.cake (CombineFrameworks, StripSign, RunLipo, RunZip) for the post-GN lipo/strip/codesign/zip steps.
  • macOS ships a plain fat .dylib (@rpath/lib<N>.dylib); iOS/tvOS/MacCatalyst frameworks are emitted directly by GN with link-time framework-relative install_name and a provenance-complete Info.plist; Cake only lipos the per-arch frameworks together and strips/codesigns last.
  • Bump externals/skia to pull in the GN-emits-framework support (Emit Apple .framework from the skiasharp_build GN target skia#256).
  • Document the new pure-GN flow in update-skia known-gotchas (Text measurement support #23).

Verification

Built from source for every Apple platform and checked against the released 3.119.0 baseline (per platform × both libs):

  • symbol counts (887 sk_/gr_, 560 hb_)
  • fat archs (x86_64 arm64)
  • framework-relative install_name (Versions/A/ for Mac Catalyst)
  • valid codesign
  • sim slices: x86_64LC_VERSION_MIN_*, arm64LC_BUILD_VERSION
  • Info.plist key set identical to the released NuGets (Mac Catalyst: UIDeviceFamily [2], LSMinimumSystemVersion 10.15)

Runtime tests: iOS simulator (iPhone 14 Pro) and Mac Catalyst both pass 5548 / 0.

Dependency

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4164

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4164"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4164/packages --name skiasharp-pr-4164
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4164

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been deployed and is available at:

🔗 View Staging Site
🔗 View Staging Docs
🔗 View Staging Gallery (Blazor)
🔗 View Staging Gallery (Uno Platform)
🔗 View Staging SkiaFiddle

This preview will be updated automatically when you push new commits to this PR.


This comment is automatically updated by the documentation staging workflow.

@mattleibow mattleibow force-pushed the mattleibow/apple-gn-off-main branch from 1d90176 to 70786a8 Compare June 15, 2026 09:18
Replace the hand-maintained Xcode projects for libSkiaSharp and
libHarfBuzzSharp with the existing GN `skiasharp_build` targets, matching
how Linux, Windows, WASM and Android already build.

- Delete all 6 *.xcodeproj bundles (ios/tvos/macos × both libs) and
  scripts/infra/native/apple/xcode.cake.
- Rewrite native/{ios,tvos,macos}/build.cake to drive GN/ninja only.
- Add scripts/infra/native/apple/apple.cake (CombineFrameworks, StripSign,
  RunLipo, RunZip) for the post-GN lipo/strip/codesign/zip steps.
- macOS ships a plain fat .dylib (@rpath/lib<N>.dylib); iOS/tvOS/MacCatalyst
  frameworks are emitted directly by GN with link-time framework-relative
  install_name and provenance-complete Info.plist; Cake only lipos per-arch
  frameworks together and strips/codesigns last.
- Bump externals/skia to pull in the GN-emits-framework support.
- Document the new flow in update-skia known-gotchas (#23).

Verified against the released 3.119.0 baseline on all four Apple platforms
(symbol counts 887 sk_/gr_ + 560 hb_, fat archs, framework-relative
install_name, valid codesign, Info.plist key parity). iOS simulator and
Mac Catalyst test suites pass 5548/0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattleibow mattleibow force-pushed the mattleibow/apple-gn-off-main branch from 70786a8 to 420d8fc Compare June 15, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Build Apple native libraries with GN instead of hand-maintained Xcode projects

1 participant