mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-28 08:08:02 +00:00
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.
12 lines
447 B
Rust
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()
|
|
}
|