Przeglądaj źródła

feat(tauri-cli): add dylib support to `tauri.bundle.macOS.frameworks`, closes #4615 (#5732)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
alesharik 2 lat temu
rodzic
commit
ce76d95ab1

+ 5 - 0
.changes/add-dylib-support-to-macos-frameworks.md

@@ -0,0 +1,5 @@
+---
+"tauri-bundler": patch
+---
+
+Add dylib support to `tauri.bundle.macOS.frameworks`.

+ 11 - 0
tooling/bundler/src/bundle/macos/app.rs

@@ -229,6 +229,17 @@ fn copy_frameworks_to_bundle(bundle_directory: &Path, settings: &Settings) -> cr
         .expect("Couldn't get framework filename");
       common::copy_dir(&src_path, &dest_dir.join(&src_name))?;
       continue;
+    } else if framework.ends_with(".dylib") {
+      let src_path = PathBuf::from(framework);
+      if !src_path.exists() {
+        return Err(crate::Error::GenericError(format!(
+          "Library not found: {}",
+          framework
+        )));
+      }
+      let src_name = src_path.file_name().expect("Couldn't get library filename");
+      common::copy_file(&src_path, &dest_dir.join(&src_name))?;
+      continue;
     } else if framework.contains('/') {
       return Err(crate::Error::GenericError(format!(
         "Framework path should have .framework extension: {}",