added build.rs

This commit is contained in:
2025-03-18 10:26:28 +03:00
parent 7f62a0a29e
commit f73e5c1043
2 changed files with 27 additions and 0 deletions
+1
View File
@@ -7,6 +7,7 @@ description = "A tool that helps to build .msp file mod"
readme = "README.md" readme = "README.md"
license = "MIT" license = "MIT"
keywords = ["switch", "nintendo", "mod", "mods", "msp"] keywords = ["switch", "nintendo", "mod", "mods", "msp"]
build = "build.rs"
[dependencies] [dependencies]
+26
View File
@@ -0,0 +1,26 @@
use std::process::Command;
use std::path::Path;
fn main() {
let switch_tools_dir = Path::new("switch-tools");
let autogen_status = Command::new("./autogen.sh")
.current_dir(switch_tools_dir)
.status()
.expect("Couldn't run autogen.sh");
let conf_status = Command::new("./configure")
.current_dir(switch_tools_dir)
.status().
expect("Couldn't run configure");
let make_status = Command::new("make")
.current_dir(switch_tools_dir)
.status()
.expect("Couldn't run make");
if !autogen_status.success() || !conf_status.success() || !make_status.success() {
panic!("Something went wrong trying to build switch-tools");
}
}