Browse Source

Merge pull request #40 from rust3ds/fix/rustflags

Revert RUSTFLAGS removal
pull/42/head
Meziu 1 year ago committed by GitHub
parent
commit
1372661285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/lib.rs

9
src/lib.rs

@ -60,14 +60,21 @@ pub fn run_cargo(cmd: &CargoCmd, message_format: Option<String>) -> (ExitStatus,
/// if there is no pre-built std detected in the sysroot, `build-std` will be used instead. /// 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<String>) -> Command { pub fn make_cargo_command(cmd: &CargoCmd, message_format: &Option<String>) -> Command {
let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string());
let mut command = Command::new(cargo);
let mut command = Command::new(cargo);
command.arg(cmd.subcommand_name()); command.arg(cmd.subcommand_name());
// Any command that needs to compile code will run under this environment. // 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. // 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() { 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 command
.env("RUSTFLAGS", rust_flags)
.arg("--target") .arg("--target")
.arg("armv6k-nintendo-3ds") .arg("armv6k-nintendo-3ds")
.arg("--message-format") .arg("--message-format")

Loading…
Cancel
Save