//////////////////////////////////////////////////////////////////////// // // build.rs - links the pre-compiled MIDACO library libmidacors.a, // which lies next to Cargo.toml, into the program. Nothing is // compiled here. // //////////////////////////////////////////////////////////////////////// fn main() { let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| String::from(".")); println!("cargo:rerun-if-changed=libmidacors.a"); println!("cargo:rustc-link-search=native={}", dir); println!("cargo:rustc-link-lib=static=midacors"); let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default(); if os != "windows" && os != "macos" { println!("cargo:rustc-link-lib=m"); } }