Skip to content

Commit

Permalink
Remove redundant target checks (#2973)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Apr 5, 2024
1 parent f4be25d commit 879c0cf
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 60 deletions.
8 changes: 0 additions & 8 deletions crates/targets/aarch64_gnullvm/build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
fn main() {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
let target = std::env::var("TARGET").unwrap();
if family != "windows" || arch != "aarch64" || env != "gnu" || !target.ends_with("-gnullvm") {
return;
}

let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

println!("cargo:rustc-link-search=native={}", std::path::Path::new(&dir).join("lib").display());
Expand Down
7 changes: 0 additions & 7 deletions crates/targets/aarch64_msvc/build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
fn main() {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
if family != "windows" || arch != "aarch64" || env != "msvc" {
return;
}

let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

println!("cargo:rustc-link-search=native={}", std::path::Path::new(&dir).join("lib").display());
Expand Down
7 changes: 0 additions & 7 deletions crates/targets/i686_gnu/build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
fn main() {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
if family != "windows" || arch != "x86" || env != "gnu" {
return;
}

let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

println!("cargo:rustc-link-search=native={}", std::path::Path::new(&dir).join("lib").display());
Expand Down
8 changes: 0 additions & 8 deletions crates/targets/i686_gnullvm/build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
fn main() {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
let target = std::env::var("TARGET").unwrap();
if family != "windows" || arch != "x86" || env != "gnu" || !target.ends_with("-gnullvm") {
return;
}

let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

println!("cargo:rustc-link-search=native={}", std::path::Path::new(&dir).join("lib").display());
Expand Down
7 changes: 0 additions & 7 deletions crates/targets/i686_msvc/build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
fn main() {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
if family != "windows" || arch != "x86" || env != "msvc" {
return;
}

let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

println!("cargo:rustc-link-search=native={}", std::path::Path::new(&dir).join("lib").display());
Expand Down
8 changes: 0 additions & 8 deletions crates/targets/x86_64_gnu/build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
fn main() {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
let target = std::env::var("TARGET").unwrap();
if family != "windows" || arch != "x86_64" || env != "gnu" || !target.ends_with("-gnu") {
return;
}

let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

println!("cargo:rustc-link-search=native={}", std::path::Path::new(&dir).join("lib").display());
Expand Down
8 changes: 0 additions & 8 deletions crates/targets/x86_64_gnullvm/build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
fn main() {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
let target = std::env::var("TARGET").unwrap();
if family != "windows" || arch != "x86_64" || env != "gnu" || !target.ends_with("-gnullvm") {
return;
}

let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

println!("cargo:rustc-link-search=native={}", std::path::Path::new(&dir).join("lib").display());
Expand Down
7 changes: 0 additions & 7 deletions crates/targets/x86_64_msvc/build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
fn main() {
let family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
if family != "windows" || arch != "x86_64" || env != "msvc" {
return;
}

let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

println!("cargo:rustc-link-search=native={}", std::path::Path::new(&dir).join("lib").display());
Expand Down

0 comments on commit 879c0cf

Please sign in to comment.