Jelajahi Sumber

[flutter]: update windows crate type

annie 3 tahun lalu
induk
melakukan
59922b95a9

+ 4 - 2
Makefile.toml

@@ -48,7 +48,8 @@ RUST_COMPILE_TARGET = "x86_64-pc-windows-msvc"
 BUILD_FLAG = "debug"
 BUILD_FLAG = "debug"
 FLUTTER_OUTPUT_DIR = "Debug"
 FLUTTER_OUTPUT_DIR = "Debug"
 PRODUCT_EXT = "exe"
 PRODUCT_EXT = "exe"
-SDK_EXT = "lib"
+CRATE_TYPE = "cdylib"
+SDK_EXT = "dll"
 
 
 [env.production-desktop-windows-x86]
 [env.production-desktop-windows-x86]
 BUILD_FLAG = "release"
 BUILD_FLAG = "release"
@@ -56,7 +57,8 @@ TARGET_OS = "windows"
 RUST_COMPILE_TARGET = "x86_64-pc-windows-msvc"
 RUST_COMPILE_TARGET = "x86_64-pc-windows-msvc"
 FLUTTER_OUTPUT_DIR = "Release"
 FLUTTER_OUTPUT_DIR = "Release"
 PRODUCT_EXT = "exe"
 PRODUCT_EXT = "exe"
-SDK_EXT = "lib"
+CRATE_TYPE = "cdylib"
+SDK_EXT = "dll"
 
 
 [tasks.echo_env]
 [tasks.echo_env]
 script = [
 script = [

+ 2 - 1
app_flowy/packages/flowy_sdk/.gitignore

@@ -75,4 +75,5 @@ build/
 
 
 **/*.dylib
 **/*.dylib
 **/*.a
 **/*.a
-**/*.lib
+**/*.lib
+**/*.dll

+ 1 - 1
app_flowy/packages/flowy_sdk/lib/ffi.dart

@@ -15,7 +15,7 @@ DynamicLibrary _open() {
   if (Platform.isAndroid) return DynamicLibrary.open('libdart_ffi.so');
   if (Platform.isAndroid) return DynamicLibrary.open('libdart_ffi.so');
   if (Platform.isMacOS) return DynamicLibrary.executable();
   if (Platform.isMacOS) return DynamicLibrary.executable();
   if (Platform.isIOS) return DynamicLibrary.executable();
   if (Platform.isIOS) return DynamicLibrary.executable();
-  if (Platform.isWindows) return DynamicLibrary.executable();
+  if (Platform.isWindows) return DynamicLibrary.open('dart_ffi.dll');
   throw UnsupportedError('This platform is not supported.');
   throw UnsupportedError('This platform is not supported.');
 }
 }
 
 

+ 5 - 0
app_flowy/packages/flowy_sdk/windows/dart_ffi/README.md

@@ -0,0 +1,5 @@
+# Debug Mode
+ 
+
+# Release Mode
+These DLLS need to be copied into the /Release folder each time we export a build.