aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOndřej Čertík <ondrej@certik.us>2020-01-14 13:34:41 -0700
committerOndřej Čertík <ondrej@certik.us>2020-01-14 13:34:41 -0700
commit8215872be25a06640b2a126fdc9f66e11f9b518a (patch)
tree428cce9c5f10e8fa02aaab2144c4adf0273039d7 /src
parentc5c515d2ba1ea9430cb2581eb98899a7d19b5a67 (diff)
downloadfpm-8215872be25a06640b2a126fdc9f66e11f9b518a.tar.gz
fpm-8215872be25a06640b2a126fdc9f66e11f9b518a.zip
Construct the correct cmake call on Windows
Diffstat (limited to 'src')
-rw-r--r--src/main.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 59e4c81..35dde13 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -44,8 +44,17 @@ project(p1)
add_executable(p1 main.f90 {})
", files2);
std::fs::write("CMakeLists.txt", s).unwrap();
+
+ let mut args: Vec<&str> = vec![];
+ if cfg!(windows) {
+ args.extend(vec!["-G", "MinGW Makefiles",
+ "-DCMAKE_SH=CMAKE_SH-NOTFOUND"])
+ };
+ args.extend(vec!["-B", "build", "."]);
+ println!("[+] cmake {:?}", args);
let output = std::process::Command::new("cmake")
- .args(&["-B", "build", "."])
+ .args(&args)
+ .env("FC", "gfortran")
.output().unwrap();
println!("status: {}", output.status);
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
@@ -54,8 +63,11 @@ add_executable(p1 main.f90 {})
panic!("Command failed.")
}
+ println!("");
+ let args = vec!["--build", "build"];
+ println!("[+] cmake {:?}", args);
let output = std::process::Command::new("cmake")
- .args(&["--build", "build"])
+ .args(&args)
.output().unwrap();
println!("status: {}", output.status);
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));