aboutsummaryrefslogtreecommitdiffhomepage
path: root/detours-sys/build.rs
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-01-16 22:28:48 +0100
committerGitHub <[email protected]>2021-01-16 22:28:48 +0100
commitff8135e8a308e8e3e155e6873989423ccad7a27a (patch)
tree7b34d0d7b8944c28fd1c3ecbff1af7ca5ef6767b /detours-sys/build.rs
parent09f679693bec135776380c92409f4693587ff482 (diff)
downloadZLUDA-ff8135e8a308e8e3e155e6873989423ccad7a27a.tar.gz
ZLUDA-ff8135e8a308e8e3e155e6873989423ccad7a27a.zip
Add a library for dumping kernels arguments before and after launch (#18)
Diffstat (limited to 'detours-sys/build.rs')
-rw-r--r--detours-sys/build.rs25
1 files changed, 10 insertions, 15 deletions
diff --git a/detours-sys/build.rs b/detours-sys/build.rs
index f3da0e6..20bb342 100644
--- a/detours-sys/build.rs
+++ b/detours-sys/build.rs
@@ -1,10 +1,8 @@
-use std::error::Error;
-
#[cfg(not(target_os = "windows"))]
fn main() {}
#[cfg(target_os = "windows")]
-fn main() -> Result<(), Box<dyn Error>> {
+fn main() -> Result<(), Box<dyn std::error::Error>> {
windows::main_impl()
}
@@ -37,18 +35,15 @@ mod windows {
.try_compile("detours")?;
Ok(())
}
-
- #[cfg(target_env = "msvc")]
- fn add_target_options(build: &mut cc::Build) -> &mut cc::Build {
- build
- }
-
- #[cfg(not(target_env = "msvc"))]
fn add_target_options(build: &mut cc::Build) -> &mut cc::Build {
- build
- .compiler("clang")
- .cpp(true)
- .flag("-fms-extensions")
- .flag("-Wno-everything")
+ if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() != "msvc" {
+ build
+ .compiler("clang")
+ .cpp(true)
+ .flag("-fms-extensions")
+ .flag("-Wno-everything")
+ } else {
+ build
+ }
}
}