From cd877d7883e375dcabacd8032f7079f60bac00e5 Mon Sep 17 00:00:00 2001 From: chyyran Date: Tue, 17 Sep 2024 21:25:10 -0400 Subject: [PATCH] build: respect CARGO env in build script --- librashader-build-script/src/main.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/librashader-build-script/src/main.rs b/librashader-build-script/src/main.rs index 882d2f5..2fe8762 100644 --- a/librashader-build-script/src/main.rs +++ b/librashader-build-script/src/main.rs @@ -32,7 +32,9 @@ pub fn main() -> ExitCode { let crate_dir = Path::new("librashader-capi"); 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.args(["--package", "librashader-capi"]); cmd.arg(format!( @@ -50,12 +52,8 @@ pub fn main() -> ExitCode { } if args.stable { - carlog_warning!( - "building librashader with stable Rust compatibility" - ); - carlog_warning!( - "C headers will not be generated" - ); + carlog_warning!("building librashader with stable Rust compatibility"); + carlog_warning!("C headers will not be generated"); cmd.args(["--features", "stable"]); } if !args.cargoflags.is_empty() {