fn main() {
println!(
"cargo:rustc-check-cfg=cfg(fuser_mount_impl, values(\"pure-rust\", \"libfuse2\", \"libfuse3\"))"
);
#[cfg(all(not(feature = "libfuse"), not(target_os = "linux")))]
unimplemented!("Building without libfuse is only supported on Linux");
#[cfg(not(feature = "libfuse"))]
{
println!("cargo:rustc-cfg=fuser_mount_impl=\"pure-rust\"");
}
#[cfg(feature = "libfuse")]
{
if cfg!(target_os = "macos") {
if pkg_config::Config::new()
.atleast_version("2.6.0")
.probe("fuse") .map_err(|e| eprintln!("{e}"))
.is_ok()
{
println!("cargo:rustc-cfg=fuser_mount_impl=\"libfuse2\"");
println!("cargo:rustc-cfg=feature=\"macfuse-4-compat\"");
} else {
pkg_config::Config::new()
.atleast_version("2.6.0")
.probe("osxfuse") .map_err(|e| eprintln!("{e}"))
.unwrap();
println!("cargo:rustc-cfg=fuser_mount_impl=\"libfuse2\"");
}
} else {
if pkg_config::Config::new()
.atleast_version("3.0.0")
.probe("fuse3")
.map_err(|e| eprintln!("{e}"))
.is_ok()
{
println!("cargo:rustc-cfg=fuser_mount_impl=\"libfuse3\"");
} else {
pkg_config::Config::new()
.atleast_version("2.6.0")
.probe("fuse")
.map_err(|e| eprintln!("{e}"))
.unwrap();
println!("cargo:rustc-cfg=fuser_mount_impl=\"libfuse2\"");
}
}
}
}