Use target-specific dependencies for mandatory system libs

This commit is contained in:
Joonas Javanainen 2019-06-27 23:09:01 +03:00
parent abeaa9ce6a
commit 607a0c7df4
No known key found for this signature in database
GPG Key ID: D39CCA5CB19B9179
2 changed files with 6 additions and 3 deletions

View File

@ -15,3 +15,9 @@ travis-ci = { repository = "Gekkio/imgui-rs" }
[build-dependencies]
cc = "1.0"
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = "0.6"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["imm"] }

View File

@ -30,8 +30,5 @@ fn main() -> io::Result<()> {
build.file(path);
}
build.compile("libcimgui.a");
if std::env::var("TARGET").unwrap().contains("-apple") {
println!("cargo:rustc-link-lib=framework=CoreFoundation");
}
Ok(())
}