update ios and macos

This commit is contained in:
wgh19
2024-04-23 16:08:05 +08:00
parent 6e46c64c92
commit 2c7d60cc1c
2 changed files with 15 additions and 12 deletions

View File

@@ -113,17 +113,21 @@ abstract base class JSRuntime extends Opaque {}
abstract base class JSPropertyEnum extends Opaque {} abstract base class JSPropertyEnum extends Opaque {}
final DynamicLibrary _qjsLib = Platform.environment['FLUTTER_TEST'] == 'true' final DynamicLibrary _qjsLib = () {
? (Platform.isWindows if (Platform.isMacOS || Platform.isIOS) {
? DynamicLibrary.open('test/build/Debug/ffiquickjs.dll') return DynamicLibrary.open('flutter_qjs.framework/flutter_qjs');
: Platform.isMacOS }
? DynamicLibrary.open('test/build/libffiquickjs.dylib') if (Platform.isAndroid) {
: DynamicLibrary.open('test/build/libffiquickjs.so')) return DynamicLibrary.open('libqjs.so');
: (Platform.isWindows }
? DynamicLibrary.open('flutter_qjs_plugin.dll') if (Platform.isLinux) {
: Platform.isAndroid return DynamicLibrary.open('libflutter_qjs_plugin.so');
? DynamicLibrary.open('libqjs.so') }
: DynamicLibrary.process()); if (Platform.isWindows) {
return DynamicLibrary.open('flutter_qjs_plugin.dll');
}
throw UnsupportedError('Unknown platform: ${Platform.operatingSystem}');
}();
/// DLLEXPORT JSValue *jsThrow(JSContext *ctx, JSValue *obj) /// DLLEXPORT JSValue *jsThrow(JSContext *ctx, JSValue *obj)
final Pointer<JSValue> Function( final Pointer<JSValue> Function(

View File

@@ -19,7 +19,6 @@ This plugin is a simple js engine for flutter using the `quickjs` project. Plugi
s.platform = :osx, '10.11' s.platform = :osx, '10.11'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.vendored_libraries = 'build/Debug/libffiquickjs.dylib'
s.prepare_command = 'sh ../cxx/prebuild.sh' s.prepare_command = 'sh ../cxx/prebuild.sh'
s.swift_version = '5.0' s.swift_version = '5.0'
end end