summaryrefslogtreecommitdiffstats
path: root/vendor/sysinfo/build.rs
blob: 43730093409ece15a0ec9da7acd5a8830364fb66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
fn main() {
    let is_apple = std::env::var("TARGET")
        .map(|t| t.contains("-apple"))
        .unwrap_or(false);
    let is_ios = std::env::var("CARGO_CFG_TARGET_OS")
        .map(|s| s == "ios")
        .unwrap_or(false);

    if is_apple {
        if !is_ios {
            // DiskArbitration is not available on iOS: https://developer.apple.com/documentation/diskarbitration
            println!("cargo:rustc-link-lib=framework=DiskArbitration");
            // IOKit is not available on iOS: https://developer.apple.com/documentation/iokit
            println!("cargo:rustc-link-lib=framework=IOKit");
        }

        println!("cargo:rustc-link-lib=framework=Foundation");
    }
}