mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 17:56:48 +03:00
20 lines
491 B
Rust
20 lines
491 B
Rust
use std::process::Command;
|
|
use std::env;
|
|
//use std::path::Path;
|
|
|
|
fn main() {
|
|
let out_dir = env::current_dir().unwrap();
|
|
let dest_path = out_dir.join("target").join("kindc");
|
|
|
|
let status = Command::new("ghc")
|
|
.args(&["-O2", "-o", dest_path.to_str().unwrap(), "src/kindc.hs"])
|
|
.status()
|
|
.expect("Failed to execute GHC");
|
|
|
|
if !status.success() {
|
|
panic!("GHC compilation failed");
|
|
}
|
|
|
|
println!("cargo:rerun-if-changed=src/kindc.hs");
|
|
}
|