Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pubspec.lock
# Generated binaries
android/src/main/jniLibs/
ios/Frameworks/
macos/Frameworks/

# Generated android build files(.cxx)
android/app/.cxx
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This project provides the [ThorVG](https://github.com/thorvg/thorvg) runtime for
| ------------- | ------------- |
| Android | arm64-v8a, armeabi-v7a, x86_64 |
| iOS | arm64, x86_64, x86_64(simulator) |
| macOS | arm64, x86_64 |

## Usage

Expand Down Expand Up @@ -113,3 +114,13 @@ sh flutter_build.ios.sh

Check whether this file is generated:
- `ios/Frameworks/libthorvg.dylib`

### macOS
```sh
# Build for Animation(Lottie)
cd lottie
sh flutter_build.macos.sh
```

Check whether this file is generated:
- `macos/Frameworks/libthorvg.dylib`
23 changes: 23 additions & 0 deletions cross/macos_arm64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# build for macOS Apple Silicon

[binaries]
cpp = ['clang++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk']
ar = 'ar'
strip = 'strip'

[properties]
root = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer'
has_function_printf = true

[built-in options]
cpp_args = ['-mmacosx-version-min=10.14']
cpp_link_args = ['-mmacosx-version-min=10.14']

[host_machine]
system = 'darwin'
subsystem = 'macos'
kernel = 'xnu'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'

23 changes: 23 additions & 0 deletions cross/macos_x86_64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# build for macOS Intel

[binaries]
cpp = ['clang++', '-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk']
ar = 'ar'
strip = 'strip'

[properties]
root = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer'
has_function_printf = true

[built-in options]
cpp_args = ['-mmacosx-version-min=10.14']
cpp_link_args = ['-mmacosx-version-min=10.14']

[host_machine]
system = 'darwin'
subsystem = 'macos'
kernel = 'xnu'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
7 changes: 7 additions & 0 deletions example/macos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Flutter-related
**/Flutter/ephemeral/
**/Pods/

# Xcode-related
**/dgph
**/xcuserdata/
2 changes: 2 additions & 0 deletions example/macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
2 changes: 2 additions & 0 deletions example/macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
10 changes: 10 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Generated file. Do not edit.
//

import FlutterMacOS
import Foundation


func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
}
42 changes: 42 additions & 0 deletions example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
22 changes: 22 additions & 0 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PODS:
- FlutterMacOS (1.0.0)
- thorvg (1.0.0-beta.0):
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- thorvg (from `Flutter/ephemeral/.symlinks/plugins/thorvg/macos`)

EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral
thorvg:
:path: Flutter/ephemeral/.symlinks/plugins/thorvg/macos

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
thorvg: cd85d234f639201c8d58d80ea923e136c6deffd7

PODFILE CHECKSUM: 7eb978b976557c8c1cd717d8185ec483fd090a82

COCOAPODS: 1.16.2
Loading