Files
dbx/src-tauri/build.rs
T
t8y2 65d184fd03 fix: skip macOS framework lookup in dev mode via build.rs
Use CARGO_MANIFEST_DIR to detect whether CI-copied dylibs exist.
When absent (local dev), override frameworks to empty array so
tauri dev doesn't require libodbc/libltdl installed locally.

Also gitignore *.dylib in src-tauri/ to prevent accidental commits.
2026-05-07 22:21:13 +08:00

12 lines
447 B
Rust

fn main() {
#[cfg(target_os = "macos")]
{
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()
}