Browse Source

Remove useless RUSTFLAGS changes

pull/36/head
Andrea Ciliberti 2 years ago
parent
commit
b899ff9d7e
  1. 2
      README.md
  2. 6
      src/command.rs
  3. 6
      src/lib.rs

2
README.md

@ -30,7 +30,7 @@ See [passthrough arguments](#passthrough-arguments) for more details. @@ -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

6
src/command.rs

@ -4,7 +4,7 @@ use std::io::Read; @@ -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 { @@ -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<String>),
}
@ -129,7 +129,7 @@ pub struct New { @@ -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,

6
src/lib.rs

@ -61,11 +61,6 @@ pub fn run_cargo(cmd: &CargoCmd, message_format: Option<String>) -> (ExitStatus, @@ -61,11 +61,6 @@ pub fn run_cargo(cmd: &CargoCmd, message_format: Option<String>) -> (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<String>) -> 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<String>) @@ -78,7 +73,6 @@ pub fn make_cargo_build_command(cmd: &CargoCmd, message_format: &Option<String>)
};
command
.env("RUSTFLAGS", rust_flags)
.arg(cmd_str)
.arg("--target")
.arg("armv6k-nintendo-3ds")

Loading…
Cancel
Save