From 50530b112f726436dfdfed934cdfbc607c2217c6 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 19 Jul 2023 13:03:05 +0200 Subject: [PATCH 1/2] Revert RUSTFLAGS removal --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 0af6431..a76f9e5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,6 +60,7 @@ pub fn run_cargo(cmd: &CargoCmd, message_format: Option) -> (ExitStatus, /// if there is no pre-built std detected in the sysroot, `build-std` will be used instead. pub fn make_cargo_command(cmd: &CargoCmd, message_format: &Option) -> Command { let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); + let mut command = Command::new(cargo); command.arg(cmd.subcommand_name()); @@ -67,7 +68,14 @@ pub fn make_cargo_command(cmd: &CargoCmd, message_format: &Option) -> Co // Any command that needs to compile code will run under this environment. // Even `clippy` and `check` need this kind of context, so we'll just assume any other `Passthrough` command uses it too. if cmd.should_compile() { + let rust_flags = env::var("RUSTFLAGS").unwrap_or_default() + + &format!( + " -L{}/libctru/lib -lctru", + env::var("DEVKITPRO").expect("DEVKITPRO is not defined as an environment variable") + ); + command + .env("RUSTFLAGS", rust_flags) .arg("--target") .arg("armv6k-nintendo-3ds") .arg("--message-format") From d2f50fcc84708d8bf6ba6bf1b0d5a0b83945d51d Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 19 Jul 2023 13:13:48 +0200 Subject: [PATCH 2/2] fmt --- src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index a76f9e5..d376b6d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,7 +62,6 @@ pub fn make_cargo_command(cmd: &CargoCmd, message_format: &Option) -> Co let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let mut command = Command::new(cargo); - command.arg(cmd.subcommand_name()); // Any command that needs to compile code will run under this environment.