cfg_if
This commit is contained in:
parent
ffa9655a06
commit
a4e303ef3f
1 changed files with 9 additions and 10 deletions
19
sys/build.rs
19
sys/build.rs
|
|
@ -36,16 +36,15 @@ fn main() {
|
||||||
println!("cargo:rustc-link-lib=cublas");
|
println!("cargo:rustc-link-lib=cublas");
|
||||||
println!("cargo:rustc-link-lib=cudart");
|
println!("cargo:rustc-link-lib=cudart");
|
||||||
println!("cargo:rustc-link-lib=cublasLt");
|
println!("cargo:rustc-link-lib=cublasLt");
|
||||||
#[cfg(target_os = "windows")]
|
cfg_if! {
|
||||||
{
|
if #[cfg(target_os = "windows")] {
|
||||||
let cuda_path = PathBuf::from(env::var("CUDA_PATH").unwrap()).join("lib/x64");
|
let cuda_path = PathBuf::from(env::var("CUDA_PATH").unwrap()).join("lib/x64");
|
||||||
println!("cargo:rustc-link-search={}", cuda_path.display());
|
println!("cargo:rustc-link-search={}", cuda_path.display());
|
||||||
}
|
} else {
|
||||||
#[cfg(not(target_os = "windows"))]
|
println!("cargo:rustc-link-lib=culibos");
|
||||||
{
|
println!("cargo:rustc-link-search=/usr/local/cuda/lib64");
|
||||||
println!("cargo:rustc-link-lib=culibos");
|
println!("cargo:rustc-link-search=/opt/cuda/lib64");
|
||||||
println!("cargo:rustc-link-search=/usr/local/cuda/lib64");
|
}
|
||||||
println!("cargo:rustc-link-search=/opt/cuda/lib64");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println!("cargo:rerun-if-changed=wrapper.h");
|
println!("cargo:rerun-if-changed=wrapper.h");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue