diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore index 9deb0834e..b0cadf41d 100644 --- a/src-tauri/.gitignore +++ b/src-tauri/.gitignore @@ -1,3 +1,5 @@ # Generated by Cargo /target/ /gen/schemas +# CI-only: copied by release workflow for macOS bundling +*.dylib diff --git a/src-tauri/build.rs b/src-tauri/build.rs index c1cd5c9d3..61b288e35 100644 --- a/src-tauri/build.rs +++ b/src-tauri/build.rs @@ -1,9 +1,11 @@ fn main() { - // In dev mode, skip framework bundling to avoid requiring libodbc/libltdl locally. - // CI copies the dylibs into src-tauri/ before release builds. #[cfg(target_os = "macos")] - if std::env::var("TAURI_CONFIG").is_err() && !std::path::Path::new("libodbc.2.dylib").exists() { - std::env::set_var("TAURI_CONFIG", r#"{"bundle":{"macOS":{"frameworks":[]}}}"#); + { + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string()); + let has_dylibs = std::path::Path::new(&manifest_dir).join("libodbc.2.dylib").exists(); + if !has_dylibs && std::env::var("TAURI_CONFIG").is_err() { + std::env::set_var("TAURI_CONFIG", r#"{"bundle":{"macOS":{"frameworks":[]}}}"#); + } } tauri_build::build() }