aboutsummaryrefslogtreecommitdiff
path: root/winpty/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'winpty/build.rs')
-rw-r--r--winpty/build.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/winpty/build.rs b/winpty/build.rs
new file mode 100644
index 00000000..90d81803
--- /dev/null
+++ b/winpty/build.rs
@@ -0,0 +1,12 @@
+use std::fs::copy;
+use std::path::Path;
+
+fn main() {
+ // The working directory for `cargo test` is in the deps folder, not the debug/release root
+ if cfg!(test) && Path::new("target").exists() {
+ #[cfg(debug_assertions)]
+ copy("../assets/windows/x86_64/winpty-agent.exe", "target/debug/deps/winpty-agent.exe").unwrap();
+ #[cfg(not(debug_assertions))]
+ copy("../assets/windows/x86_64/winpty-agent.exe", "target/release/deps/winpty-agent.exe").unwrap();
+ }
+}