From b530b48950267b1ba1151a272182eab88cb59400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Mon, 27 Jan 2020 23:24:20 -0700 Subject: Use absolute path to p1 --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3