diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-01-14 13:34:41 -0700 |
---|---|---|
committer | Ondřej Čertík <ondrej@certik.us> | 2020-01-14 13:34:41 -0700 |
commit | 8215872be25a06640b2a126fdc9f66e11f9b518a (patch) | |
tree | 428cce9c5f10e8fa02aaab2144c4adf0273039d7 /src | |
parent | c5c515d2ba1ea9430cb2581eb98899a7d19b5a67 (diff) | |
download | fpm-8215872be25a06640b2a126fdc9f66e11f9b518a.tar.gz fpm-8215872be25a06640b2a126fdc9f66e11f9b518a.zip |
Construct the correct cmake call on Windows
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 16 |
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)); |