aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOndřej Čertík <ondrej@certik.us>2020-01-27 23:24:20 -0700
committerOndřej Čertík <ondrej@certik.us>2020-01-27 23:25:25 -0700
commitb530b48950267b1ba1151a272182eab88cb59400 (patch)
tree58f1c368dedb755b626403ae8f812bd1d485e8ef /src
parenteef71c890651062a4bcd97d053654ef9ed270f26 (diff)
downloadfpm-b530b48950267b1ba1151a272182eab88cb59400.tar.gz
fpm-b530b48950267b1ba1151a272182eab88cb59400.zip
Use absolute path to p1
Diffstat (limited to 'src')
-rw-r--r--src/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index fec41a3..be71598 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -94,8 +94,17 @@ add_executable(p1 ../main.f90 {})
}
}
+fn p1_bin(target_dir: &Path) -> std::process::Command {
+ let mut fpm_bin_relative: std::path::PathBuf = target_dir.to_path_buf();
+ fpm_bin_relative.push("build");
+ fpm_bin_relative.push("p1");
+ fpm_bin_relative.set_extension(std::env::consts::EXE_EXTENSION);
+ let fpm_bin_absolute = std::fs::canonicalize(fpm_bin_relative).unwrap();
+ std::process::Command::new(fpm_bin_absolute.to_str().unwrap())
+}
+
fn run(target_dir: &Path) {
- let output = std::process::Command::new("build/p1")
+ let output = p1_bin(target_dir)
.current_dir(target_dir)
.output().unwrap();
println!("status: {}", output.status);