build: respect CARGO env in build script

This commit is contained in:
chyyran 2024-09-17 21:25:10 -04:00
parent d56d92ea0f
commit cd877d7883

View file

@ -32,7 +32,9 @@ pub fn main() -> ExitCode {
let crate_dir = Path::new("librashader-capi"); let crate_dir = Path::new("librashader-capi");
carlog_info!("Building", "librashader C API"); carlog_info!("Building", "librashader C API");
let mut cmd = Command::new("cargo"); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string());
let mut cmd = Command::new(&cargo);
cmd.arg("build"); cmd.arg("build");
cmd.args(["--package", "librashader-capi"]); cmd.args(["--package", "librashader-capi"]);
cmd.arg(format!( cmd.arg(format!(
@ -50,12 +52,8 @@ pub fn main() -> ExitCode {
} }
if args.stable { if args.stable {
carlog_warning!( carlog_warning!("building librashader with stable Rust compatibility");
"building librashader with stable Rust compatibility" carlog_warning!("C headers will not be generated");
);
carlog_warning!(
"C headers will not be generated"
);
cmd.args(["--features", "stable"]); cmd.args(["--features", "stable"]);
} }
if !args.cargoflags.is_empty() { if !args.cargoflags.is_empty() {