Skip to content

Commit 1372661

Browse files
authored
Merge pull request #40 from rust3ds/fix/rustflags
Revert RUSTFLAGS removal
2 parents 2467531 + d2f50fc commit 1372661

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,21 @@ pub fn run_cargo(cmd: &CargoCmd, message_format: Option<String>) -> (ExitStatus,
6060
/// if there is no pre-built std detected in the sysroot, `build-std` will be used instead.
6161
pub fn make_cargo_command(cmd: &CargoCmd, message_format: &Option<String>) -> Command {
6262
let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string());
63-
let mut command = Command::new(cargo);
6463

64+
let mut command = Command::new(cargo);
6565
command.arg(cmd.subcommand_name());
6666

6767
// Any command that needs to compile code will run under this environment.
6868
// Even `clippy` and `check` need this kind of context, so we'll just assume any other `Passthrough` command uses it too.
6969
if cmd.should_compile() {
70+
let rust_flags = env::var("RUSTFLAGS").unwrap_or_default()
71+
+ &format!(
72+
" -L{}/libctru/lib -lctru",
73+
env::var("DEVKITPRO").expect("DEVKITPRO is not defined as an environment variable")
74+
);
75+
7076
command
77+
.env("RUSTFLAGS", rust_flags)
7178
.arg("--target")
7279
.arg("armv6k-nintendo-3ds")
7380
.arg("--message-format")

0 commit comments

Comments
 (0)