From b899ff9d7ee65eb19b179b765b9e6bad00076ed9 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 29 Jun 2023 19:02:45 +0200 Subject: [PATCH] Remove useless RUSTFLAGS changes --- README.md | 2 +- src/command.rs | 6 +++--- src/lib.rs | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 92dc166..88c68bb 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ See [passthrough arguments](#passthrough-arguments) for more details. It is also possible to pass any other `cargo` command (e.g. `doc`, `check`), and all its arguments will be passed through directly to `cargo` unmodified, -with the proper `RUSTFLAGS` and `--target` set for the 3DS target. +with the proper `--target armv6k-nintendo-3ds` set. ### Basic Examples diff --git a/src/command.rs b/src/command.rs index 847cd33..26b9a9d 100644 --- a/src/command.rs +++ b/src/command.rs @@ -4,7 +4,7 @@ use std::io::Read; use cargo_metadata::Message; use clap::{Args, Parser, Subcommand}; -use crate::{CTRConfig, build_3dsx, build_smdh, get_metadata, link}; +use crate::{build_3dsx, build_smdh, get_metadata, link, CTRConfig}; #[derive(Parser, Debug)] #[command(name = "cargo", bin_name = "cargo")] @@ -46,7 +46,7 @@ pub enum CargoCmd { // NOTE: it seems docstring + name for external subcommands are not rendered // in help, but we might as well set them here in case a future version of clap // does include them in help text. - /// Run any other `cargo` command with RUSTFLAGS set for the 3DS. + /// Run any other `cargo` command with custom building tailored for the 3DS. #[command(external_subcommand, name = "COMMAND")] Passthrough(Vec), } @@ -129,7 +129,7 @@ pub struct New { } impl CargoCmd { - /// Whether or not this command should compile any code, and thus needs import the custom environment configuration (e.g. RUSTFLAGS, target, std). + /// Whether or not this command should compile any code, and thus needs import the custom environment configuration (e.g. target spec). pub fn should_compile(&self) -> bool { matches!( self, diff --git a/src/lib.rs b/src/lib.rs index 13a3f91..156e01f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,11 +61,6 @@ pub fn run_cargo(cmd: &CargoCmd, message_format: Option) -> (ExitStatus, /// Create a cargo command used for building based on the context. /// If there is no pre-built std detected in the sysroot, `build-std` is used. pub fn make_cargo_build_command(cmd: &CargoCmd, message_format: &Option) -> Command { - 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") - ); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let sysroot = find_sysroot(); let mut command = Command::new(cargo); @@ -78,7 +73,6 @@ pub fn make_cargo_build_command(cmd: &CargoCmd, message_format: &Option) }; command - .env("RUSTFLAGS", rust_flags) .arg(cmd_str) .arg("--target") .arg("armv6k-nintendo-3ds")