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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:ffi';
import 'dart:io';

import 'svg/path_ops.dart';

/// Look up the location of the pathops from flutter's artifact cache.
Expand All @@ -20,13 +22,31 @@ bool initializePathOpsFromFlutterCache() {
final String platform;
final String executable;
if (Platform.isWindows) {
platform = 'windows-x64';
if (Abi.current() == Abi.windowsX64) {
platform = 'windows-x64';
} else if (Abi.current() == Abi.windowsArm64) {
platform = 'windows-arm64';
} else {
throw Exception('Unsupported ABI: ${Abi.current()}');
}
executable = 'path_ops.dll';
} else if (Platform.isMacOS) {
platform = 'darwin-x64';
if (Abi.current() == Abi.macosX64) {
platform = 'darwin-x64';
} else if (Abi.current() == Abi.macosArm64) {
platform = 'darwin-arm64';
} else {
throw Exception('Unsupported ABI: ${Abi.current()}');
}
executable = 'libpath_ops.dylib';
} else if (Platform.isLinux) {
platform = 'linux-x64';
if (Abi.current() == Abi.linuxX64) {
platform = 'linux-x64';
} else if (Abi.current() == Abi.linuxArm64) {
platform = 'linux-arm64';
} else {
throw Exception('Unsupported ABI: ${Abi.current()}');
}
executable = 'libpath_ops.so';
} else {
print('path_ops not supported on ${Platform.localeName}');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:ffi';
import 'dart:io';

import 'svg/tessellator.dart';

/// Look up the location of the tessellator from flutter's artifact cache.
Expand All @@ -20,13 +22,31 @@ bool initializeTessellatorFromFlutterCache() {
final String platform;
final String executable;
if (Platform.isWindows) {
platform = 'windows-x64';
if (Abi.current() == Abi.windowsX64) {
platform = 'windows-x64';
} else if (Abi.current() == Abi.windowsArm64) {
platform = 'windows-arm64';
} else {
throw Exception('Unsupported ABI: ${Abi.current()}');
}
executable = 'libtessellator.dll';
} else if (Platform.isMacOS) {
platform = 'darwin-x64';
if (Abi.current() == Abi.macosX64) {
platform = 'darwin-x64';
} else if (Abi.current() == Abi.macosArm64) {
platform = 'darwin-arm64';
} else {
throw Exception('Unsupported ABI: ${Abi.current()}');
}
executable = 'libtessellator.dylib';
} else if (Platform.isLinux) {
platform = 'linux-x64';
if (Abi.current() == Abi.linuxX64) {
platform = 'linux-x64';
} else if (Abi.current() == Abi.linuxArm64) {
platform = 'linux-arm64';
} else {
throw Exception('Unsupported ABI: ${Abi.current()}');
}
executable = 'libtessellator.so';
} else {
print('Tesselation not supported on ${Platform.localeName}');
Expand Down