aboutsummaryrefslogtreecommitdiffhomepage
path: root/ext/amd_comgr-sys/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/amd_comgr-sys/build.rs')
-rw-r--r--ext/amd_comgr-sys/build.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/amd_comgr-sys/build.rs b/ext/amd_comgr-sys/build.rs
new file mode 100644
index 0000000..f89fc38
--- /dev/null
+++ b/ext/amd_comgr-sys/build.rs
@@ -0,0 +1,20 @@
+use std::env::VarError;
+use std::{env, path::PathBuf};
+
+fn main() -> Result<(), VarError> {
+ if cfg!(windows) {
+ println!("cargo:rustc-link-lib=dylib=amd_comgr_2");
+ let env = env::var("CARGO_CFG_TARGET_ENV")?;
+ if env == "msvc" {
+ let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
+ path.push("lib");
+ println!("cargo:rustc-link-search=native={}", path.display());
+ } else {
+ println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
+ };
+ } else {
+ println!("cargo:rustc-link-lib=dylib=amd_comgr");
+ println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
+ }
+ Ok(())
+}