Skip to content

Commit

Permalink
Relax the build target checks for gnu and gnullvm targets as well
Browse files Browse the repository at this point in the history
  • Loading branch information
seritools committed Jan 4, 2024
1 parent 4d3a01a commit 3c5c3d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion crates/targets/aarch64_gnullvm/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
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 target != "aarch64-pc-windows-gnullvm" {
if family != "windows" || arch != "aarch64" || env != "gnu" || !target.ends_with("-gnullvm") {
return;
}

Expand Down
6 changes: 4 additions & 2 deletions crates/targets/i686_gnu/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
fn main() {
let target = std::env::var("TARGET").unwrap();
if target != "i686-pc-windows-gnu" && target != "i686-uwp-windows-gnu" {
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;
}

Expand Down
5 changes: 4 additions & 1 deletion crates/targets/x86_64_gnu/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
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 target != "x86_64-pc-windows-gnu" && target != "x86_64-uwp-windows-gnu" {
if family != "windows" || arch != "x86_64" || env != "gnu" || !target.ends_with("-gnu") {
return;
}

Expand Down
5 changes: 4 additions & 1 deletion crates/targets/x86_64_gnullvm/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
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 target != "x86_64-pc-windows-gnullvm" {
if family != "windows" || arch != "x86_64" || env != "gnullvm" || !target.ends_with("-gnullvm") {
return;
}

Expand Down

0 comments on commit 3c5c3d5

Please sign in to comment.