Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds macOS platform support (arm64 + x86_64 universal) for the ThorVG Flutter FFI plugin, including build script, CocoaPods integration, example app, and documentation updates.
- Adds macOS target declarations (pubspec + podspec) and dynamic library loading branch in Dart.
- Introduces build script to produce a universal binary (needs adjustments for producing a .dylib properly).
- Adds full macOS example project, configs, and README instructions.
Reviewed Changes
Copilot reviewed 28 out of 38 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| thorvg | Updated submodule commit to newer ThorVG revision supporting macOS build. |
| pubspec.yaml | Declares macOS as an FFI plugin platform. |
| macos/thorvg.podspec | New Podspec for macOS CocoaPods integration. |
| lottie/flutter_build.macos.sh | New macOS universal build script (static/shared build logic). |
| lib/src/thorvg.dart | Adds macOS dynamic library load branch; minor formatting change. |
| example/macos/RunnerTests/RunnerTests.swift | Adds empty XCTest file for macOS example. |
| example/macos/Runner/Release.entitlements | Sandbox entitlements for release. |
| example/macos/Runner/MainFlutterWindow.swift | Main Flutter window implementation. |
| example/macos/Runner/Info.plist | macOS app Info.plist. |
| example/macos/Runner/DebugProfile.entitlements | Debug/profile entitlements. |
| example/macos/Runner/Configs/Warnings.xcconfig | Compiler warning settings. |
| example/macos/Runner/Configs/Release.xcconfig | Release build includes Flutter + warnings. |
| example/macos/Runner/Configs/Debug.xcconfig | Debug build includes Flutter + warnings. |
| example/macos/Runner/Configs/AppInfo.xcconfig | App metadata (name, bundle id, copyright). |
| example/macos/Runner/Base.lproj/MainMenu.xib | Main menu UI definition. |
| example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json | App icon asset definitions. |
| example/macos/Runner/AppDelegate.swift | App delegate overrides for termination & state. |
| example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | Xcode workspace checks plist. |
| example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | Xcode build scheme. |
| example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | Duplicate workspace checks plist. |
| example/macos/Runner.xcodeproj/project.pbxproj | Full Xcode project file for macOS example. |
| example/macos/Podfile | CocoaPods setup for macOS (platform 10.14). |
| example/macos/Flutter/GeneratedPluginRegistrant.swift | Generated plugin registrant (empty). |
| example/macos/Flutter/Flutter-Release.xcconfig | Includes Pods + generated settings (Release). |
| example/macos/Flutter/Flutter-Debug.xcconfig | Includes Pods + generated settings (Debug). |
| example/macos/.gitignore | Ignores Pods/ephemeral/Xcode user data. |
| example/.gitignore | Adds macOS / Swift build artifacts ignores. |
| README.md | Documents macOS support & build steps. |
Files not reviewed (1)
- example/macos/Runner.xcworkspace/contents.xcworkspacedata: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tinyjin
left a comment
There was a problem hiding this comment.
Thank you. Please check the comments
|
Also please check comment here: We might need the cross files to support universal binary (currently we combine them in fat binary). However as I commented there, technically we're able to build macOS without cross file. If that is only need for Flutter build system, we better move the cross files into |
5234b6f to
9b2044b
Compare
tinyjin
left a comment
There was a problem hiding this comment.
Thank you. Suggesting minor changes
| @@ -0,0 +1,23 @@ | |||
| # build for macOS Apple Silicon | |||
There was a problem hiding this comment.
could be better to move cross file to each platform for clarify.
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "33CC10EC2044A3C60003C045" | ||
| BuildableName = "thorvg_example.app" |
There was a problem hiding this comment.
example app's identifier is org.thorvg.example
- Add macOS example app and Xcode configuration - Configure pubspec.yaml for macOS compatibility - Create shell script for libthorvg.dylib generation
- Add cross-compilation files and build script for macOS arm64/x86_64
9b2044b to
73274c8
Compare
Summary
Adds macOS platform support to ThorVG Flutter with universal binary support for both Apple Silicon (arm64) and Intel (x86_64) architectures.
Changes
pubspec.yamlas supported FFI plugin platformlottie/flutter_build.macos.shscript that builds universal binariesthorvg/cross/macos_arm64.txtandthorvg/cross/macos_x86_64.txtfor macOS cross-compilationmacos/thorvg.podspecfor macOS integrationBuild Command:
Output:
macos/Frameworks/libthorvg.dylib(universal binary)